共用方式為


Settings.Secure.SetLocationProviderEnabled Method

Definition

Caution

deprecated

Thread-safe method for enabling or disabling a single location provider.

[Android.Runtime.Register("setLocationProviderEnabled", "(Landroid/content/ContentResolver;Ljava/lang/String;Z)V", "")]
[System.Obsolete("deprecated")]
public static void SetLocationProviderEnabled (Android.Content.ContentResolver? cr, string? provider, bool enabled);
[<Android.Runtime.Register("setLocationProviderEnabled", "(Landroid/content/ContentResolver;Ljava/lang/String;Z)V", "")>]
[<System.Obsolete("deprecated")>]
static member SetLocationProviderEnabled : Android.Content.ContentResolver * string * bool -> unit

Parameters

cr
ContentResolver

the content resolver to use

provider
String

the location provider to enable or disable

enabled
Boolean

true if the provider should be enabled

Attributes

Remarks

Thread-safe method for enabling or disabling a single location provider. This will have no effect on Android Q and above.

This member is deprecated. This API is deprecated

Java documentation for android.provider.Settings.Secure.setLocationProviderEnabled(android.content.ContentResolver, java.lang.String, boolean).

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