Class Info |
|---|
public class LocationAvailability implements Parcelable, IMessageEntity Device location availability. |
Qualifier and Type | Field and Description |
|---|---|
static final Creator<LocationAvailability> | Default builder for deserializing LocationAvailability. |
Qualifier and Type | Method Name and Description |
|---|---|
static LocationAvailability | extractLocationAvailability(Intent intent) Obtains a LocationAvailability instance. |
int | Obtains the device location status. |
static boolean | hasLocationAvailability(Intent intent) Checks whether the intent contains LocationAvailability. |
boolean | Checks whether the device location is known. |
void | setLocationStatus(int locationStatus) Sets the device location status. |
Fields |
|---|
public static final Creator<LocationAvailability> CREATOR Default builder for deserializing LocationAvailability. |
Constructor |
|---|
public LocationAvailability() Builds a LocationAvailability instance. |
Method |
|---|
public static LocationAvailability extractLocationAvailability(Intent intent) Obtains a LocationAvailability instance. |
Parameters
Name | Description |
|---|---|
intent | Intent passed to the server for calling the requestLocationUpdates method. |
Returns
Type | Description |
|---|---|
LocationAvailability | null if the intent does not contain the data. |
Method |
|---|
public int getLocationStatus() Obtains the device location status. |
Returns
Type | Description |
|---|---|
int | Device location status. |
Method |
|---|
public static boolean hasLocationAvailability(Intent intent) Checks whether the intent contains LocationAvailability. This method returns true if the intent contains LocationAvailability. It is a utility function that can be called inside an intent receiver to ensure that the received intent contains location availability data. |
Parameters
Name | Description |
|---|---|
intent | Intent passed to the server for calling the requestLocationUpdates method. |
Returns
Type | Description |
|---|---|
boolean | true if the intent contains LocationAvailability; false otherwise. |
Method |
|---|
public boolean isLocationAvailable() Checks whether the device location is known. This method returns true if the device location is known. Failure to determine location may result from a number of causes, including disabled location settings or an inability to obtain sensor data from the device environment. |
Returns
Type | Description |
|---|---|
boolean | true if the value of locationStatus is less than 1000; false otherwise. |