问题描述
我是我targetSdkVersion设置为23,所以我想实现
请求在运行时的权限。 (请参见)
I am setting my targetSdkVersion to 23 and therefore I want to implement"Requesting permissions at runtime". (see here)
皮棉直接调用出来,如果你忘了检查和许可
告诉你以下内容:
Lint directly calls out if you forget to check the permission andtells you the following:
呼叫需要可由用户被拒绝权限:code必须
明确检查是否许可可用(与
的checkPermission
)或明确处理潜力
`SecurityException异常
这是相当不错的,我想分析一下我的code任何电话,我可能
都忘记了,但是我找不到我必须选择林特选项
在我检查的个人资料。
This is quite nice and I want to analyze my code for any call that I mayhave forgotten, but I can't find Lint option that I have to selectin my Inspection profile.
怎么叫的检查?
谢谢!
How is the inspection called?Thanks!
推荐答案
在赫克托首先单击督察(有胡子的男人在Android Studio中的最右下角的小图标)。这将打开一个选项配置检查。
First click on Hector the Inspector (the small icon of a man with a moustache at the very bottom-right of Android Studio). This will bring up an option to Configure inspections.
您应该然后键入权限到搜索栏,并确保常数和资源的类型不匹配被选中。在此之后,它是通过运行分析检查的一个简单的例子>检查code。
You should then type 'Permissions' into the searchbar, and ensure that "Constant and Resource Type Mismatches" is checked. After that, it's a simple case of running an inspection via Analyse > Inspect Code.
这篇关于分析code皮棉为需要调用的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!