简体   繁体   中英

how to customize navigate stack on android

I have a situation like this

I'm using a single activity but with different parameters so I assume that they are seperate activities

This is a navigation sequence

ABCDEF, and in FI have a view that takes me to the C, or sometimes B. What I want is when I press back button, the activity must take me to my stack rather than system stack, or when I navigate back to an earlier stack it should pop activities rather than pushing them. How can I do that?

Note: I'm using a single Activity so I need to use the standart launch mode. What I need is to be able to remove Activity instances from stack to the place I navigate

Use Intent flags and launch mode - look at this free app to help you work out easily what different flags and modes do: https://market.android.com/details?id=com.novoda.demos.activitylaunchmode

See this page for more help : http://developer.android.com/guide/topics/fundamentals/tasks-and-back-stack.html

You should use INTENT_FLAGS or LAUNCH_MODE to manage your task stack. Also you can use ActivityGroup class and manually manage activities into this group by your parameters and other conditions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM