I have some activities in my app: A - Login Activity B - Main app Activity C, D ... - Inner Activities I want to implement a behaviour as follows:
- when a user select the app icon OR select the app from the task list I want the back stack to be cleared and show Activity A
- when a user passed A pressing the back on activity B will quit the application
- when a user in an inner app pressing back will function "normally".
for example: activity stack A -> B -> C -> D pressing the back button the first time (top activity is D) will make pop the D of the stack top and it will be: A -> B -> C clicking again (top activity is C) will move us to A -> B and clicking again will quit the app (as described in 2)
I implemented (2) by adding android:noHistory="true"
to A's properties in AndroidManifest.xml
and tried to implement (1) by adding android:launchMode=singleTop
to A's properties in AndroidManifest.xml
but when I do that (3) is breaked and clicking back when D is visible moves me directly to A.
how can I implement them all?
Thanks!