Android.Locations.LocationManager.IsProviderEnabled Method
Returns the current enabled/disabled status of the given provider.

Syntax

[Android.Runtime.Register("isProviderEnabled", "(Ljava/lang/String;)Z", "GetIsProviderEnabled_Ljava_lang_String_Handler")]
public virtual bool IsProviderEnabled (string provider)

Parameters

provider
the name of the provider

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif provider is null

Remarks

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

If the user has enabled this provider in the Settings menu, true is returned otherwise false is returned

Callers should instead use NoType:android/provider/Settings$Secure;Href=../../../reference/android/provider/Settings.Secure.html#LOCATION_MODE unless they depend on provider-specific APIs such as LocationManager.RequestLocationUpdates(string, System.Int64, System.Int64, System.Int64).

Before API version NoType:android/os/Build$VERSION_CODES;Href=../../../reference/android/os/Build.VERSION_CODES.html#LOLLIPOP, this method would throw Java.Lang.SecurityException if the location permissions were not sufficient to use the specified provider.

[Android Documentation]

Requirements

Namespace: Android.Locations
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1