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
Post a Comment