From 2c896a801e59a9138b7c3e5930aa62317a0a5073 Mon Sep 17 00:00:00 2001 From: Dmitry Yunitsky Date: Fri, 19 Jun 2015 17:07:48 +0300 Subject: [PATCH] Bugfix for fragment, that couldn't be popped after activity called onSaveInstanceState. --- android/src/com/mapswithme/maps/MWMActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/android/src/com/mapswithme/maps/MWMActivity.java b/android/src/com/mapswithme/maps/MWMActivity.java index feb5f718cf..e2b8b82b42 100644 --- a/android/src/com/mapswithme/maps/MWMActivity.java +++ b/android/src/com/mapswithme/maps/MWMActivity.java @@ -1188,13 +1188,15 @@ public class MWMActivity extends BaseMwmFragmentActivity return false; Fragment fragment = manager.findFragmentByTag(SearchFragment.class.getName()); - if (fragment != null) + // TODO we cant pop fragment, if it isn't resumed, cause of 'at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1375)' + // consider other possibilities here + if (fragment != null && fragment.isResumed()) { manager.popBackStack(); return true; } fragment = manager.findFragmentByTag(DownloadFragment.class.getName()); - if (fragment != null) + if (fragment != null && fragment.isResumed()) { manager.popBackStack(); return true;