当编译targetSDKVersion < 23时使用

ContextCompat.checkSelfPermission and Context.checkSelfPermission将会不起作用

需要使用

PermissionChecker.checkSelfPermission

同样targetSDKVersion >= 23时PermissionChecker.checkSelfPermission也会无效,

需要使用ContextCompat.checkSelfPermission

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐