Giter Club home page Giter Club logo

Comments (3)

soulqw avatar soulqw commented on June 9, 2024

你好,首先看崩溃日志应该不是库里面的崩溃,你细看一下 Location 类的获取是不是没做判空处理。
至于为什么会走到onAllPermissionOk,你确认下是否有在Manifest文件中声明相关权限,如果声明了权限, 还是走到这个回调的话,就应该是厂商自己实现的权限系统。
如何验证:
1.你在 onAllPermissionOk 里面方法体注释掉只加个日志,再重启一次,如果即没出授权弹框,又走到了这个回调。
2.你在onCreate 中单独调用 Location location = Util.getLocation(MainActivity.this); 是否会出授权弹框
确认以上两点的话,应该就是正常的操作了,厂商自定义权限系统也是默认授权成功的,细节上你可以看下博客

from soulpermission.

Yofun avatar Yofun commented on June 9, 2024

vivo手机是自己定义了权限系统,就是这个原因,所以在点击拒绝授权的时候也会走onAllPermissionOk的回调,所以才会报location为null的错。这种情况该怎么处理呢?拒绝授权后还会走onAllPermissionOk的这种情况

问题原因:https://blog.csdn.net/aabbwoshishei/article/details/76022152

from soulpermission.

soulqw avatar soulqw commented on June 9, 2024

比如你这里,还是同样的代码,在调用位置的代码处try/catch ,异常提示用户手动开启权限

from soulpermission.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.