diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java index ec702af..a1044b1 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java @@ -208,7 +208,9 @@ public class MainActivity extends ActionBarActivity { } else { ctx.replace(R.id.fragments, panoramioShower, PanoramioShowerFragment.TAG); } - ctx.addToBackStack(PHOTO_BACKSTACK); + if (!savedConfiguration) { + ctx.addToBackStack(PHOTO_BACKSTACK); + } ctx.commit(); @@ -220,8 +222,6 @@ public class MainActivity extends ActionBarActivity { photoInfo = null; } - savedConfiguration = false; - if (photoInfo != null) { switchToPhoto(photoInfo); return; @@ -241,6 +241,8 @@ public class MainActivity extends ActionBarActivity { break; } + savedConfiguration = false; + } private void switchFragment(Fragment fragment, String tag) { @@ -274,7 +276,7 @@ public class MainActivity extends ActionBarActivity { } else { ctx.replace(R.id.fragments, frag); } - ctx.addToBackStack(MAIN_BACKSTACK); + // ctx.addToBackStack(MAIN_BACKSTACK); ctx.commit(); updateSwipeHandler(); }