I have the following code in my onActivityResult for a fragment of mine:
onActivityResult(int requestCode, int resultCode, Intent data){
//other code
P
I believe it is an Android bug. Basically Android calls onActivityResult at a wrong point in the activity/fragment lifecycle (before onStart()).
The bug is reported at https://issuetracker.google.com/issues/36929762
I solved it by basically storing the Intent as a parameter I later processed in onResume().
[EDIT] There are nowadays better solutions for this issue that were not available back in 2012. See the other answers.