Manifest.Permission.ACCESS_COARSE_LOCATION的权限被拒绝



我正在练习将谷歌地图API与Android集成。

当我试图获得的权限时

Manifest.permission.ACCESS_FINE_LOCATIONManifest.permission.ACCESS_COARSE_LOCATION,对Manifest.permission.ACCESS_COARSE_LOCATION的权限被拒绝。但是,已授予Manifest.permission.ACCESS_FINE_LOCATION的权限。我想知道Manifest.permission.ACCESS_COARSE_LOCATION被拒绝的原因。感谢您的帮助。


创造这种乐趣(Kotlin(

fun setupPermissions(context:Context,activity: Activity,permission: String, requestCode: Int) {
if (ContextCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_DENIED) {
// Requesting the permission
ActivityCompat.requestPermissions(activity, arrayOf(permission), requestCode)
return
}
}

之后呼叫

setupPermissions(requireContext(),requireActivity(),*CAMERA*,234)

相关内容

  • 没有找到相关文章

最新更新