I have a main Activity which creates a fragment. My fragment launches various activities for result. Both main Activity and the fragment have onActivityResult(...) methods.
The main Activity receives all the results, even those from activities started from the fragment. The (int resultCode) that is received in the main onActivityResult(...int resultCode...) is being mangled somehow. So instead of the resultCode being 100 as i've set it to, it's 64978.
So even though i'm passing the resultCode arguments on to my fragment's onActivityResult(...) the resultCode is wrong. What's going on with the result code?
Thanks!
You can call super.onActivityResult(...)
in the Activity's onActivityResult()
to ensure the result is passed down to the Fragment, or alternatively if you want the activity to deal with the result, you can use getActivity().startActivityForResult(...)
in the Fragment when you are starting the other activities.