Summary: Inherited Constants | Fields | Methods | Inherited Methods | [Expand All]
public final class

# LocationResult

extends Object
implements SafeParcelable Parcelable

java.lang.Object
↳ | com.google.android.gms.location.LocationResult

## Class Overview

A data class representing a geographic location result from the fused location provider.

All locations returned by `getLocations()` are guaranteed to have a valid latitude, longitude, and UTC timestamp. On API level 17 or later they are also guaranteed to have elapsed real-time since boot. All other parameters are optional.

## Summary

[Expand] Inherited Constants
From interface com.google.android.gms.common.internal.safeparcel.SafeParcelable
String | NULL |
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Fields
public static final Creator<LocationResult> | CREATOR |

Public Methods
static LocationResult | create(List<Location> locations) Creates a `LocationResult` for the given locations.
boolean | equals(Object other)
static LocationResult | extractResult(Intent intent) Extracts the `LocationResult` from an Intent.
Location | getLastLocation() Returns the most recent location available in this result, or null if no locations are available.
List<Location> | getLocations() Returns locations computed, ordered from oldest to newest.
static boolean | hasResult(Intent intent) Returns true if an Intent contains a `LocationResult`.
int | hashCode()
String | toString()
void | writeToParcel(Parcel parcel, int flags)

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## Fields

#### public static final Creator<LocationResult> CREATOR

## Public Methods

#### public static LocationResult create (List<Location> locations)

Creates a `LocationResult` for the given locations.

#### public boolean equals (Object other)

#### public static LocationResult extractResult (Intent intent)

Extracts the `LocationResult` from an Intent.

This is a utility function which extracts the `LocationResult` from the extras of an Intent that was sent from the fused location provider.

##### Returns

- a `LocationResult`, or `null` if the Intent doesn't contain a result.

#### public Location getLastLocation ()

Returns the most recent location available in this result, or null if no locations are available.

#### public List<Location> getLocations ()

Returns locations computed, ordered from oldest to newest.

No duplicate locations will be returned to any given listener (i.e. locations will not overlap in time between subsequent calls to a listener).

#### public static boolean hasResult (Intent intent)

Returns true if an Intent contains a `LocationResult`.

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

##### Returns

- true if the intent contains a `LocationResult`, false otherwise.

#### public int hashCode ()

#### public String toString ()

#### public void writeToParcel (Parcel parcel, int flags)