For those who have problem with wrong requestCode in onActivityResult
If you are calling startActivityForResult()
from your Fragment
, the requestCode is changed by the Activity that owns the Fragment.
If you want to get the correct resultCode in your activity try this:
Change:
startActivityForResult(intent, 1);
To:
getActivity().startActivityForResult(intent, 1);