Share via


LocationManager.IsProviderEnabled(String) Method

Definition

Returns the current enabled/disabled status of the given provider.

[Android.Runtime.Register("isProviderEnabled", "(Ljava/lang/String;)Z", "GetIsProviderEnabled_Ljava_lang_String_Handler")]
public virtual bool IsProviderEnabled (string provider);
[<Android.Runtime.Register("isProviderEnabled", "(Ljava/lang/String;)Z", "GetIsProviderEnabled_Ljava_lang_String_Handler")>]
abstract member IsProviderEnabled : string -> bool
override this.IsProviderEnabled : string -> bool

Parameters

provider
String

a provider listed by #getAllProviders()

Returns

true if the provider exists and is enabled

Attributes

Exceptions

if provider is null

Remarks

Returns the current enabled/disabled status of the given provider. To listen for changes, see #PROVIDERS_CHANGED_ACTION.

Before API version android.os.Build.VERSION_CODES#LOLLIPOP, this method would throw SecurityException if the location permissions were not sufficient to use the specified provider.

Java documentation for android.location.LocationManager.isProviderEnabled(java.lang.String).

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