Android.Locations.LocationManager.SetTestProviderEnabled Method
Sets a mock enabled value for the given provider.

Syntax

[Android.Runtime.Register("setTestProviderEnabled", "(Ljava/lang/String;Z)V", "GetSetTestProviderEnabled_Ljava_lang_String_ZHandler")]
public virtual void SetTestProviderEnabled (string provider, bool enabled)

Parameters

provider
the provider name
enabled
the mock enabled value

Exceptions

TypeReason
Java.Lang.SecurityExceptionif the ACCESS_MOCK_LOCATION permission is not present or the NoType:android/provider/Settings$Secure;Href=../../../reference/android/provider/Settings.Secure.html#ALLOW_MOCK_LOCATION} system setting is not enabled
Java.Lang.IllegalArgumentExceptionif no provider with the given name exists

Remarks

Sets a mock enabled value for the given provider. This value will be used in place of any actual value from the 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 3