From da1347454e0c0f2d7e6c9dd220931e1bd8baeb53 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 16 Dec 2014 09:59:16 +0100 Subject: [PATCH] ClassifyActivity: Use launchMode=singleTop. So the Up button (from Help/Examples, or List, for instance) is more like the back button. Otherwise, Up navigation (correctly) ignores the back stack and just creates a new instance. But our ClassifyActivity has lots of state that we don't want to lose. Alternatively, we could have used FLAG_ACTIVITY_CLEAR_TOP when navigating up, but this seems simpler. I do wonder exactly how this is dealt with in standard apps, such as when writing an email, pressing a button to launch a photo chooser activity and then pressing Up to come back, without losing the contents of the email. However, I cannot find a real-world example like that that actually has an Up button in the helper activity. --- app/src/main/AndroidManifest.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7c7d34cd..924c448e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -48,9 +48,15 @@ android:name="android.support.PARENT_ACTIVITY" android:value="com.murrayc.galaxyzoo.app.ClassifyActivity" /> + + + + android:label="@string/app_name" + android:launchMode="singleTop">