Are you looking for a practical answer? Or was this more of a
theoretical thought experiment type of question?
If you want the practical answer, then I guess the simple thing to do
would be to kill Activity A in it's onActivityResult method (which
should be overridden since you are calling startActivityForResult on
Activity B). In other words, before B kills itself, do something like
setResult(RESULT_OK) and then kill B. Once this happens, it will
return to Activity A's onActivityResult method, and in there you can
have something like
if(resultCode == RESULT_OK) {
finish();
}
And so at this point, Activity C is what your user should see, and
Activity A/B have been killed off, and so once you kill Activity C
your Activity stack is cleared and you're good to go.
Hope this is what you were looking for.
- jwei
http://thinkandroid.wordpress.com
On Jan 6, 1:12 am, Zhihong GUO gzhh...@gmail.com wrote:
Hi all,
I have three activities. Activity A start activity B by the method
startActivityForResult, and Activity B start activity C by the method
startActivity. Then, after starting activity C, activity B kill himself by
finish(). Now the task stack stored two activities: A and C.
My question is: how can I finish activity A when I finish activity C. or how
can I clear the whole stack of the task.
Thanks a lot!
James
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en