简体   繁体   English

“写设置”权限未授予marshmallow android

[英]“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.

相关问题 Android Marshmallow:在授予权限后重新创建活动 - Android Marshmallow : activity recreates after permission granted android.permission.WRITE_SETTINGS 是否仅授予系统应用程序? - Is android.permission.WRITE_SETTINGS only granted to system apps? com.android.shell没有获得此权限:android.permission.WRITE_SETTINGS - com.android.shell was not granted this permission: android.permission.WRITE_SETTINGS java.lang.SecurityException:未被授予此权限:android.permission.WRITE_SETTINGS 关闭对话框时 [Android] - java.lang.SecurityException: was not granted this permission: android.permission.WRITE_SETTINGS when Dismiss a Dialog [Android] java.lang.SecurityException:未授予此权限:android.permission.WRITE_SETTINGS - java.lang.SecurityException: was not granted this permission: android.permission.WRITE_SETTINGS Android Marshmallow-为什么不询问用户就授予危险许可 - Android Marshmallow - Why dangerous permission is granted without asking user Android-是否可以查看WRITE_SETTINGS权限是否授予API &lt;23 - Android - Can I see if WRITE_SETTINGS permission granted API < 23 始终未授予 OS 4.0 READ_EXTERNAL_STORAGE 权限上的 Android Marshmallow 权限模型 - Android Marshmallow permission model on OS 4.0 READ_EXTERNAL_STORAGE permission always not granted 即使用户授予了权限,Android Marshmallow位置权限也不起作用 - Android Marshmallow location permission does not work even though permission is granted by user 权限在设置中被授予,但被忽略 - Permission is granted in settings but is being ignored
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM