AutocompletePrediction | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Analyze
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Nested Classes | Methods | Inherited Methods | [Expand All]
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
abstract AutocompletePrediction | freeze() Freeze a volatile representation into an immutable representation.
abstract boolean | isDataValid() Check to see if this object is valid for use.

## 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()`.