I have a Fragment that calls another Activity using:
ProductEditionMaintenanceActivity.class);
Bundle extras = new Bundle();
extras.putString("productCode", productCode);
extras.putInt("productEditionID", 0);
intent.putExtras(extras);
getActivity().startActivityForResult(intent, 1);
and return from the activity:
Intent resultIntent = new Intent();
setResult(Activity.RESULT_OK, resultIntent);
finish();
I tried to use the following in the Fragment
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
//Do something
}
However, I am guessing the intent created passed the reference of the parent Activity of the Fragment therefore onActivityResult on the Fragment does not get called. If that is the case, what do I need to do so the fragment get the result from the callee Activity?