android - How to clear stack history? -


consider having application containing activity a,b,c. launched launcher , b launched a. b has button. requirement on clicking button on b present history of activity stack a->b should clear , history stack must contain c. possible ? if plz advise me...

thanks in advance !

although tedious, can done launching using activity methods startactivityforresult(), setresult(), finish(), , onactivityresult().

in pseudo-code:

 a: startactivityforresult(b) b: startactivityforresult(c) c: startactivity(d); setresult(clear); finish() d: ... b: (onactivityresult) setresult(clear); finish() a: (onactivityresult) finish() 

if you're willing change architecture bit more "natural" way use flag_activity_clear_top easy way go a, b, c a.

a third way set a, b, , c use nohistory, lose ability out of c b or a.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -