checkSelfPermission returning PERMISSION_GRANTED for revoked permission with targetSdkVersion <= 22

前端 未结 2 1988
野的像风
野的像风 2020-12-15 05:52

I\'m studying the new permission model of Android Marshmallow but I\'m facing an issue I find odd.

An app with targetSdkVersion 22 (so not yet using the

相关标签:
2条回答
  • 2020-12-15 06:41

    Use the android.support.v4.content.PermissionChecker

    https://developer.android.com/reference/android/support/v4/content/PermissionChecker.html

    0 讨论(0)
  • 2020-12-15 06:51

    In order to use the new permission models (and checking if your app has or not the permission) you need to update your target SDK to 23. It doesn't make any sense to keeping target 22.

    0 讨论(0)
提交回复
热议问题