Settings.System.CanWrite(Context) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.