summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Paczos <lukas.paczos@gmail.com>2019-05-15 16:03:18 +0200
committerŁukasz Paczos <lukasz.paczos@mapbox.com>2019-05-15 16:58:13 +0200
commitab8caabd1576b7bcc5c29dfc69bf6b2797144058 (patch)
tree46ae9638c3d8b6efb1b5500f30d84e0105c41251
parent0ecf45edbd496d1b73fc83c98f331ad120689753 (diff)
downloadqtlocation-mapboxgl-ab8caabd1576b7bcc5c29dfc69bf6b2797144058.tar.gz
[android] fix FragmentBackStackActivity navigation
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/FragmentBackStackActivity.kt10
1 files changed, 7 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/FragmentBackStackActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/FragmentBackStackActivity.kt
index febe17a701..a642ebe594 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/FragmentBackStackActivity.kt
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/FragmentBackStackActivity.kt
@@ -45,8 +45,12 @@ class FragmentBackStackActivity : AppCompatActivity() {
}
override fun onBackPressed() {
- // activity uses singleInstance for testing purposes
- // code below provides a default navigation when using the app
- NavUtils.navigateHome(this)
+ if (supportFragmentManager.backStackEntryCount == 0) {
+ // activity uses singleInstance for testing purposes
+ // code below provides a default navigation when using the app
+ NavUtils.navigateHome(this)
+ } else {
+ super.onBackPressed()
+ }
}
} \ No newline at end of file