0

I am trying to figure the best way to control 'sets' of Activities deployed from an initial 'launch' Activity.

A>B(Launches either C1, C2 or C3) >C1>D1>E1>F1 ... etc >C2>D2>E2>F2 ... etc >C3>D3>E3>F3 ... etc 

I require the behaviour whereby a 'home' button is available on all x1, x2 and x3 Activities. When this 'home' button is pressed on a Cx Activity, it takes the user back to B, however if pressed on either Dx, Ex, Fx etc Activity, it takes them back to the Cx Activity.

If I make my C Activity declarations SingleTop, how can I make them unique (in terms of Intents) from the subsequent D, E, F etc. Activities?

1 Answer 1

3

suppose at this time your activity stack is this

{c > d > e > f} 

f is top order activity if you just want to bring up front the activity c then you should use the IntentFlag

intent.setFlag(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)}

and if you want to also clear activity that in stack which above the activity c then you should use IntentFlag

intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
Sign up to request clarification or add additional context in comments.

1 Comment

But what do I launch 'C' (proposed 'home' screen) as in the first place? NewTask?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.