次の方法で共有


Settings.System.CanWrite(Context) Method

Definition

Checks if the specified app can modify system settings.

[Android.Runtime.Register("canWrite", "(Landroid/content/Context;)Z", "", ApiSince=23)]
public static bool CanWrite (Android.Content.Context? context);
[<Android.Runtime.Register("canWrite", "(Landroid/content/Context;)Z", "", ApiSince=23)>]
static member CanWrite : Android.Content.Context -> bool

Parameters

context
Context

App context.

Returns

true if the calling app can write to system settings, false otherwise

Attributes

Remarks

Checks if the specified app can modify system settings. As of API level 23, an app cannot modify system settings unless it declares the android.Manifest.permission#WRITE_SETTINGS permission in its manifest, <em>and</em> the user specifically grants the app this capability. To prompt the user to grant this approval, the app must send an intent with the action android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS, which causes the system to display a permission management screen.

Java documentation for android.provider.Settings.System.canWrite(android.content.Context).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to