public interface

AutocompletePrediction

implements Freezable<AutocompletePrediction>
com.google.android.gms.location.places.AutocompletePrediction

Class Overview

Represents a query's suggestions and its attributes, like matched substrings.

Summary

Nested Classes
interface AutocompletePrediction.Substring Represents a matched substring in a query suggestion's description. 
Public Methods
abstract String getDescription()
The description of a predicted place.
abstract List<? extends AutocompletePrediction.Substring> getMatchedSubstrings()
Get a list of matched substrings in a query suggestion's description.
abstract String getPlaceId()
Returns the place ID of the place being referred to by this prediction, or null if this prediction is not for a place.
abstract List<Integer> getPlaceTypes()
Returns the list of place types associated with the place referred to by getPlaceId().
[Expand]
Inherited Methods
From interface com.google.android.gms.common.data.Freezable

Public Methods

public abstract String getDescription ()

The description of a predicted place.

Examples:

    Tacoma, Washington
      Taco Bell, Willitis, CA

public abstract List<? extends AutocompletePrediction.Substring> getMatchedSubstrings ()

Get a list of matched substrings in a query suggestion's description.

Each AutocompletePrediction.Substring contains an offset value and a length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired.

Returns
  • a list of matched substrings in a query suggestion's description.

public abstract String getPlaceId ()

Returns the place ID of the place being referred to by this prediction, or null if this prediction is not for a place.

public abstract List<Integer> getPlaceTypes ()

Returns the list of place types associated with the place referred to by getPlaceId().