public final class

LocationAvailability

extends Object
implements Parcelable Parcelable
java.lang.Object
   ↳ com.google.android.gms.location.LocationAvailability

Class Overview

Status on the availability of location data.

Delivered from LocationCallback registered via #requestLocationUpdates(GoogleApiClient,LocationRequest,LocationCallback,Looper) or from a PendingIntent registered via #requestLocationUpdates(GoogleApiClient, LocationRequest, PendingIntent). It is also available on demand via getLocationAvailability(GoogleApiClient).

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<LocationAvailability> CREATOR
Public Methods
boolean equals(Object o)
static LocationAvailability extractLocationAvailability(Intent intent)
Extracts the LocationAvailability from an Intent.
static boolean hasLocationAvailability(Intent intent)
Returns true if an Intent contains a LocationAvailability.
int hashCode()
boolean isLocationAvailable()
Returns true if the device location is known and reasonably up to date within the hints requested by the active LocationRequests.
String toString()
void writeToParcel(Parcel parcel, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<LocationAvailability> CREATOR

Public Methods

public boolean equals (Object o)

Parameters
o Object
Returns
boolean

public static LocationAvailability extractLocationAvailability (Intent intent)

Extracts the LocationAvailability from an Intent.

This is a utility function which extracts the LocationAvailability from the extras of an Intent that was sent in response to a location request.

Parameters
intent Intent
Returns
LocationAvailability a LocationAvailability, or null if the Intent doesn't contain this data.

public static boolean hasLocationAvailability (Intent intent)

Returns true if an Intent contains a LocationAvailability.

This is a utility function that can be called from inside an intent receiver to make sure the received intent contains location availability data.

Parameters
intent Intent
Returns
boolean true if the intent contains a LocationAvailability, false otherwise.

public int hashCode ()

Returns
int

public boolean isLocationAvailable ()

Returns true if the device location is known and reasonably up to date within the hints requested by the active LocationRequests. Failure to determine location may result from a number of causes including disabled location settings or an inability to retrieve sensor data in the device's environment.

Returns
boolean

public String toString ()

Returns
String

public void writeToParcel (Parcel parcel, int flags)

Parameters
parcel Parcel
flags int