public Location getLastKnownLocation (String provider)
Since: API Level 1
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.
Parameters
provider the name of the provider
Returns
* the last known location for the provider, or null
Throws
SecurityException if no suitable permission is present for the provider.
IllegalArgumentException if provider is null or doesn't exist
Partager