

Calling super is mandatory! It won’t work otherwise. For example, your app can start a camera app and receive the captured photo as a result.

It seems that fragments override somehow the requestCode.

But then, I noticed that the requestCode (the int value you need to use when calling startActivityForResult()) had a very strange value: requestCode=132897 I spent some time debugging the code thinking that maybe I used a wrong constant.īut that was not the case. So, I ran my app in debug mode and when I saw that the breakpoint stopped in the onActivityResult method from the activity I said, OK, at least it works here. My first impulse was to move the method inside the activity that hosts the fragment, and that’s what I actually did. Create a New Android Studio Project and select the template as Google Maps Activity. Today I had an issue with onActivityResult() method which was not called inside a fragment. Android allows us to integrate google maps in our application. In such case, we need to override the onActivityResult method that is invoked automatically when second activity returns result.
