Comments (3)
你好,首先看崩溃日志应该不是库里面的崩溃,你细看一下 Location 类的获取是不是没做判空处理。
至于为什么会走到onAllPermissionOk,你确认下是否有在Manifest文件中声明相关权限,如果声明了权限, 还是走到这个回调的话,就应该是厂商自己实现的权限系统。
如何验证:
1.你在 onAllPermissionOk 里面方法体注释掉只加个日志,再重启一次,如果即没出授权弹框,又走到了这个回调。
2.你在onCreate 中单独调用 Location location = Util.getLocation(MainActivity.this); 是否会出授权弹框
确认以上两点的话,应该就是正常的操作了,厂商自定义权限系统也是默认授权成功的,细节上你可以看下博客
from soulpermission.
vivo手机是自己定义了权限系统,就是这个原因,所以在点击拒绝授权的时候也会走onAllPermissionOk的回调,所以才会报location为null的错。这种情况该怎么处理呢?拒绝授权后还会走onAllPermissionOk的这种情况
问题原因:https://blog.csdn.net/aabbwoshishei/article/details/76022152
from soulpermission.
比如你这里,还是同样的代码,在调用位置的代码处try/catch ,异常提示用户手动开启权限
from soulpermission.
Related Issues (20)
- 内存泄漏问题 HOT 3
- Failed to resolve: com.qw:soulpermission:1.2.0 HOT 2
- string文件适配一下英文吧~ HOT 2
- 能否设置强制开启权限功 HOT 5
- apk第一次启动闪退,添加权限后,后续每次都可以打开 HOT 4
- 如图,点击允许权限,isGranted 返回的false HOT 6
- Android 5.1小米手机,申请相机权限,默认返回未授权 HOT 2
- WRITE_SETTINGS 修改系统设置 HOT 1
- onCreate中调用,有时候会出现not attached to Activity HOT 7
- java.lang.IllegalStateException: Fragment PermissionSupportFragment{9091661 #0 permission_fragment_tag} not attached to Activity 这个问题导致不能正常申请权限
- 小米4.4 存储权限 android.Manifest.permission.READ_EXTERNAL_STORAGE 返回false HOT 1
- 打基准包会出现问题 HOT 3
- 多个权限一个弹框 HOT 1
- android 10选择拒绝不在询问,onPermissionDenied死循环 HOT 1
- 什么时候支持安卓11 HOT 1
- 定位权限问题
- 1.3.1版本 FragmentManager is already executing transactions HOT 1
- 适配android13的 新动态权限了吗 HOT 1
- checkPermissions 无法在后台使用
- 怎么在请求权限时,同步展示为何请求此权限的说明?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soulpermission.