Bhavdip
5/24/2016 - 7:15 AM

[Android FLAG_ACTIVITY_FORWARD_RESULT] #tags:Android

[Android FLAG_ACTIVITY_FORWARD_RESULT] #tags:Android

Nav flow is: A => B => C => A with results from C
If you're using fragments please note that "onActivityResult" will be called according to where "startActivityForResult" is called (method "startActivityForResult" is available in both, activity and fragment)

ActivityA
   startActivityForResult(intentB, 22);

ActivityB
   intentC.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
   startActivity(intentC);
   finish();

ActivityC
   setResult(99);
   finish();