Android “onRequestPermissionsResult” not being called

前端 未结 3 697
旧巷少年郎
旧巷少年郎 2021-01-21 16:42

I\'m trying to implement Marshmallow\'s permission support, but my code inside \"onRequestPermissionsResult\" is never called. The \"onCreate\" and \"onMapReady\" parts of the c

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-21 17:27

    MY_LOCATION_REQUEST_CODE should be a non-egative constant.

    You should declare it as

    private static final int MY_LOCATION_REQUEST_CODE = 1;
    

提交回复
热议问题