I have 3 Activities: A, B, C.
I want that Activities work as follows:
A startActivityForResult B; B can start C or send result to A; C can go back to B or send result to A.
When B send result to A, B must be removed from backstack. When C send result to A, B and C must be removed from backstack.
I'm not able to send result to A from C. This means that A must be reusmed (NOT RECREATED) and onActivityResult() must be callled to process result:
I have tryed with this code but A is recreated and onActivityResult() is not called!!
public class C extends Activity{
sendResultToA(){
Intent i = new Intent(getActivity(), A.class);
i.putExtra("dataBean", dataBean);
i.putExtra("args", "save");
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getActivity().setResult(Activity.RESULT_OK, i);
startActivity(i);
}
}
Any ideas to solve this problem? Thank you