From a9af2c2015fcbfbafde82b1a5af49a4ce09369b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20P=C3=B3=C5=82grabia?= Date: Sun, 18 Sep 2016 17:21:33 +0200 Subject: [PATCH] Fixed proper navigation. --- .../java/pl/tpolgrabia/urbanexplorer/MainActivity.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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(); }