目录

CLASS info
public class LocationAvailability implements Parcelable, IMessageEntity
Device location availability.

Field Summary

Return typeMethod nameDescription
Creator<LocationAvailability>CREATORLocationAvailability builder.

Public Method Summary

Return typeMethod name
static LocationAvailabilityextractLocationAvailability(Intent intent)
static booleanhasLocationAvailability(Intent intent)
booleanisLocationAvailable()

Public Methods

Method
public static LocationAvailability extractLocationAvailability(Intent intent)
This API is used to obtain the LocationAvailability instance.

Parameters

Parameter nameParameter desc
intentIntent transferred to the server when the requestLocationUpdates API is called.

Return

typedesc
LocationAvailabilityReturn null if the Intent does not include the data.
Method
public static boolean hasLocationAvailability(Intent intent)
This API is used to check whether an Intent contains LocationAvailability. If the Intent contains LocationAvailability, this parameter returns true. This is a utility function that can be called inside an intent receiver to ensure that the received Intent contains location availability data.

Parameters

Parameter nameParameter desc
intentIntent transferred to the server when the requestLocationUpdates API is called.

Return

typedesc
booleanIf the Intent contains LocationAvailability, the value is true. Otherwise, the value is false.
Method
public boolean isLocationAvailable()
This API is used to check whether the device location is known. If yes, the value true is returned. 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.

Return

typedesc
booleanIf the value of locationStatus is smaller than 1000, this parameter returns true. Otherwise, this parameter returns false.