I read up on "tasks" and the activity life cycle. Single top launch mode seems to give me (in theory) what I'd like to have for my app, but it's not currently working as expected. It sounds simple enough, so I can't imagine I'm doing this incorrectly. From my understanding, "single top" means that my activity can be navigated to in many ways, but per Task it will act as a singleton instance moving it to the top of the Task stack when launched. Therefore, if I do either of the following: declare the activity's launchMode to be singleTop in the manifest OR launch my activity by intent with the FLAG_ACTIVITY_SINGLE_TOP flag I will get this behavior.
I have tried both methods by themselves and both together, and I don't get this behavior. I have a very simple app with two Activities. MainActivity is my "landing page" where a user can select an artist and launch the ArtistActivity with that artist's id. The user can navigate back to the landing page with a menu item as well as the back button. If the user goes back and forth by menu item clicks, a stack of activities seems to be built so that successively hitting the back button will take them step by step backwards through the actions they've taken. I was under the impression that by declaring both activities as android:launchMode="singleTop" and/or launching them with the properly flagged intent (intent.addFlag (Intent.FLAG_ACTIVITY_SINGLE_TOP), that hitting the back key would only take them through an activity once before "exiting" (visually hiding) the app. Am I getting this wrong? And if so (or not), how do I get my app with only two activities to treat the activities as a stack where my "landing page" (MainActivity) is always on the bottom? Hitting Back from MainActivity always exits (unloads/pauses?) the app (task?), and hitting Back from ArtistActivity always returns to a singleton instance of MainActivity. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

