1

Using the Google Play Location and Settings API a developer can easily check if the Android device's location settings are correct.

The API also supports fixing any settings that are not correct using the startResolutionForResult method. (It calls Activity.startActivityForResult() and provides feedback of users "yes/no" choice in the activities onActivityResult() method.)

This all works fine so far, except that I am calling startResolutionForResult from a fragment. As per this question, an intent needs to called via Fragment.startActivityForResult() for the result to be given to the fragment as well.

Is there any way of getting this result to the fragment? I was half expecting a createIntentForResolutionForResult on the ResultStatus class. Ideally I don't want to modify my containing Activity.

Community
  • 1
  • 1
Diederik
  • 5,536
  • 3
  • 44
  • 60

1 Answers1

0

You need to call super.onActivityResult on the Activity and call your Fragment from there. Otherwise its presence is there just for the sake of it and no work is done on the calling method which is startResolutionForResult in this case. Check the source of FragmentActivity.

AniV
  • 3,997
  • 1
  • 12
  • 17