My activity stack is A B C, with C at the top. A started B using startActivityForResult().
Now, in C, it starts A and clears the top using the following code:
finish();
intent = new Intent(this, A.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
My question is, will onActivityResult() in A be called after the code above is executed? I expected it will, because B is destroyed after C starts A and clears the top. But, my test code showed that onActivityResult() in A was not called. I am confused. Can someone help?
Thanks.
In your code you are starting a new Activity A, from ACTIVITY C. This will not call the onActivityResult. This simply because a new Activity A is started. onActivityResult() will be called only when u finish() your Acitivity B.
I hope someone adds more to the anwsers, if this doesn make it clear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With