Android.Locations.LocationManager.GetLastKnownLocation Method
Returns a Location indicating the data from the last known location fix obtained from the given provider.

Syntax

[Android.Runtime.Register("getLastKnownLocation", "(Ljava/lang/String;)Landroid/location/Location;", "GetGetLastKnownLocation_Ljava_lang_String_Handler")]
public virtual Location GetLastKnownLocation (string provider)

Parameters

provider
the name of the provider

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.SecurityExceptionif no suitable permission is present
Java.Lang.IllegalArgumentExceptionif provider is null or doesn't exist

Remarks

Returns a Location indicating the data from the last known location fix obtained from the given provider.

This can be done without starting the provider. Note that this location could be out-of-date, for example if the device was turned off and moved to another location.

If the provider is currently disabled, null is returned.

[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