[英]“Write settings” permission not granted marshmallow android
<uses-permission android:name="android.permission.WRITE_SETTINGS"
I have declared above line in my manifest ,and i ask for permission on activity start but unlike other permissions,after restarting my app,it again asks for permission.When i check if permission has been granted or not,i get result that says not granted for only this permission but when i checked the same thing with other permissions ,they are granted after the user has done so. 我已经在我的清单中声明了上面的行,并且我要求获得活动开始的许可,但与其他权限不同,重新启动我的应用程序后,它再次请求权限。当我检查是否已授予权限时,我得到的结果不是仅授予此权限,但当我使用其他权限检查相同的内容时,会在用户完成后授予它们。
ActivityCompat.requestPermissions(SplashScreen.this,PERMISSIONS, 1);
i check with : EasyPermissions.hasPermissions(this,PERMISSIONS) 我查看:EasyPermissions.hasPermissions(this,PERMISSIONS)
use this for write setting permission: 使用它来写入设置权限:
public void settingPermission() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (!Settings.System.canWrite(getApplicationContext())) {
Intent intent = new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS, Uri.parse("package:" + getPackageName()));
startActivityForResult(intent, 200);
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.