call requires permission which may be rejected by user;code should explicitly check to see if permis
来源:互联网 发布:梦里花落知多少演员表 编辑:程序博客网 时间:2024/05/23 19:41
Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`
百度没找到该问题,所以自己研究了下。
这句话大意是:调用需要的权限可能被用户拒绝:代码应该显式地检查权限是否可用(用checkPermission)或显式地处理一个潜在的“SecurityException”
是在使用android studio,api23出现的提示,eclipse之前没出现过。权限都已经声明了
根据提示,加上checkPermission后又提示
checkSelfPermission需要在最低api 23的版本里使用:
if (checkSelfPermission(Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) { return;}
解决方法:startActivity(intent);加try catch块。
其实忽略该问题运行也不会有问题的。
当然提示说的主要是调用需要的权限可能被用户拒绝,所以这时调用该方法会出现异常,就应该要try catch。
试着加了下,果然就没有报提示了。
原帖:http://blog.csdn.net/u010313561/article/details/49902083
0 0
- call requires permission which may be rejected by user;code should explicitly check to see if permis
- Call requires permission which may be rejected by user: code should explicitly check to see if permi
- Call requires permission which may be rejected by user: code should explicitly check to see if permi
- 使用GPS提示的问题是Call requires permission which may be rejected by user: code should explicitly check to s
- Android 23使用定位权限报错Call requires permission which may be rejected by user
- If You Design It, You Should Be Able to Code It
- 30.In which situation may the UNDO_RETENTION parameter be ignored, even if it is set to a value?
- Check if user has access to CI
- Check if user has access to CI
- 警告The argument of type String[] should explicitly be cast to Object[] for the invocation of the vara
- expreiment to see what a callback function should be When executing a query
- Warning: bind(): React component methods may only be bound to the component instance. See ...
- 【User】How to check if a user name belongs to a domain
- No job jar file set. User classes may not be found. See Job or Job#setJar(String)
- Which tool should be used to find out a "jmp esp"
- a pointer to a bound function may only be used to call the function
- a pointer to a bound function may only be used to call the function
- Androd :java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permis
- 判断一个字符串是否为数值型字符串
- 经验风险与结构风险
- 14.Adding Frontend Files to your Module
- C++中vector详细用法说明
- 初试微信订阅号有感
- call requires permission which may be rejected by user;code should explicitly check to see if permis
- node-gyp 设置 Proxy
- 2016蓝桥杯假期任务之《括号问题》
- [面试题11]把数组排成最小的数
- 【cocos2dx】状态机应用场景及原理
- Spreading the Wealth
- 实现 动态追加Imageview 追加ChildView
- 基础五
- BSTR、char*和CString转换(2)