I have 3 activities. A,B and C. A calls B, B calls C, and the result of C should be received in A. Can you please suggest how to go about it?? I m killing B using finish() after it calls C. So, the result of C should go directly to A Activityonresult. Is it possible??. Please give your suggestions!
Don't kill B, in A
start activity B
using startActivityForResult
and in B
start activity C
using startActivityForResult
then in B onActivityResult
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent)
{
super.onActivityResult(requestCode, resultCode, intent);
setResult(RESULT_OK, intent);
finish();
}
where intent is the intent sent back from C
. Now A
will receive this intent in A onActivityResult
.
What if you call C from A? Something like: A calls B; instead of calling C from B, finish it and make A call C.
Unless the result of C affects B. In such case you have no choice but handling the result of C in B, and set the result of A from there if needed.
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