ikbal
ikbal

Reputation: 1894

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

A-B-C-D-E-F, and in F I 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

Upvotes: 0

Views: 189

Answers (2)

Martyn
Martyn

Reputation: 16622

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

Upvotes: 2

Georgy Gobozov
Georgy Gobozov

Reputation: 13721

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.

Upvotes: 1

Related Questions