android - 在哪里检查 Android 权限?

标签 android android-studio android-6.0-marshmallow android-permissions

我们正在将我们的应用移至 SDK 23,并意识到我们需要在代码中明确处理权限。

是否有最佳实践(或 IDE 快捷方式)可以帮助我们确定可能需要为应用中的每个权限使用“ContextCompat.checkSelfPermission”的所有位置,而不是遍历整个代码库?

最佳答案

如果您使用的是 Android Studio,请尝试以下操作:

1- 点击 Hector the Inspector(Android Studio 右下角的 mustache 男人图标)。这将显示配置检查的选项。

2- 在搜索栏中输入“权限”,并确保选中“常量和资源类型不匹配”。

3- 运行分析 > 检查代码。

关于android - 在哪里检查 Android 权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37974592/

相关文章:

android - Eclipse 'Loading data for Android 4.4.2' 一直

android - shouldInterceptRequest 在使用非弃用时为弃用和非弃用变体调用两次

android - AsyncTask 完成后重新启动完整的 Android 应用程序

android - 如何将现有的 .so 库添加到 Android Studio 项目中?

android - 使用 Android 6.0 的 BluetoothLeScanner.startScan 无法发现设备

android-emulator - Android M(预览版)应用程序待机

android - 为什么使用 Messenger 而不是将引用传递给 Handler?

android - 如何在两个 fragment onClick 按钮之间传递参数

android - flutter工具无法访问文件

android - 我可以从设置中授予危险权限吗?