Why is LocationSettingsResult startResolutionForResult not calling onActivityResult?

后端 未结 5 1199
悲&欢浪女
悲&欢浪女 2021-02-15 04:33

I\'ve seen this Q&A LocationSettingsRequest dialog - onActivityResult() skipped. It isn\'t the same issue because everything is being done in an Activity already.

Th

5条回答
  •  说谎
    说谎 (楼主)
    2021-02-15 05:12

    If you are running this code in Fragment than don't use startResolutionForResult(). Instead use startIntentSenderForResult(status.getResolution().getIntentSender(), REQUEST_CODE_LOCATION_SETTING, null, 0, 0, 0, null);

    and overrider onaActivityResult() in your fragment. Result will be delivered to this method only.

提交回复
热议问题