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. For more information about place autocomplete, see the developer's guide.

Summary

Public Methods
abstract CharSequence getFullText(CharacterStyle matchStyle)
The full text of a place.
abstract String getPlaceId()
Returns the place ID of the place being referred to by this prediction.
abstract List<Integer> getPlaceTypes()
Returns the list of place types associated with the place referred to by getPlaceId().
abstract CharSequence getPrimaryText(CharacterStyle matchStyle)
The primary text of a place.
abstract CharSequence getSecondaryText(CharacterStyle matchStyle)
The secondary text of a place.
[Expand]
Inherited Methods
From interface com.google.android.gms.common.data.Freezable

Public Methods

public abstract CharSequence getFullText (CharacterStyle matchStyle)

The full text of a place. This is a combination of the primary text and the secondary text.

Example: "Eiffel Tower, Avenue Anatole France, Paris, France"

If you do not wish to highlight matches, you can pass null.

Parameters
matchStyle CharacterStyle
Returns
CharSequence

public abstract String getPlaceId ()

Returns the place ID of the place being referred to by this prediction. For more information on place IDs, see the place ID overview.

Returns
String

public abstract List<Integer> getPlaceTypes ()

Returns the list of place types associated with the place referred to by getPlaceId(). For more information on place types, see the place types overview.

Returns
List<Integer>

public abstract CharSequence getPrimaryText (CharacterStyle matchStyle)

The primary text of a place. This will usually be the name of the place.

Example: "Eiffel Tower", "123 Pitt Street"

See getFullText(CharacterStyle) for more information on formatting.

Parameters
matchStyle CharacterStyle
Returns
CharSequence

public abstract CharSequence getSecondaryText (CharacterStyle matchStyle)

The secondary text of a place. This provides extra context on the place, and can be used as a second line when showing autocomplete predictions.

Example: "Avenue Anatole France, Paris, France", "Sydney, New South Wales"

See getFullText(CharacterStyle) for more information on formatting.

Parameters
matchStyle CharacterStyle
Returns
CharSequence