当我在装有Android 6.0及更高版本的设备上使用Android Studio安装和启动我的应用程序时,出现了一个问题,即即使状态为在设备上启用了位置服务,在专门针对我的应用程序的电话设置中也会禁用位置服务酒吧。这是与地理位置相关的应用授权菜单:
我的 list :
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature android:name="android.hardware.location.gps"
android:required="false"/>
Gradle依赖项:
compile 'com.google.android.gms:play-services-location:10.0.1'
关于如何解决此问题的任何想法?
最佳答案
Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app.
请阅读本文有关在运行时请求权限的文章:
https://developer.android.com/training/permissions/requesting.html
关于android - Android 6.0+:我的应用禁用了地理位置定位(即使在手机设置和 list 中启用了地理位置定位),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41804041/