Summary: Nested Classes | Constants | Methods | Inherited Methods | [Expand All]
public class

# PlaceAutocomplete

extends Object

java.lang.Object
↳ | com.google.android.gms.location.places.ui.PlaceAutocomplete

## Class Overview

PlaceAutocomplete provides an activity that allows a user to start typing a place name or an address and see place predictions appear as they type.

Users are expected to choose one of the predictions. Unlike `PlacePicker`, users only see a list of places, and not a full map. See the developer's guide for more details.

If the user exits the autocomplete activity without choosing a place, the calling activity will receive `RESULT_CANCELED`.

## Summary

Nested Classes
class | PlaceAutocomplete.IntentBuilder | Builder for a Place Autocomplete launch intent.

Constants
int | MODE_FULLSCREEN | Mode for launching the autocomplete activity in fullscreen.
int | MODE_OVERLAY | Mode for launching the autocomplete activity as an overlay.
int | RESULT_ERROR | Indicates that an error occurred.

Public Methods
static Place | getPlace(Context context, Intent intent) Returns the `Place` selected by the user.
static Status | getStatus(Context context, Intent intent) Returns the `Status` associated with the result.

[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()

## Constants

#### public static final int MODE_FULLSCREEN

Mode for launching the autocomplete activity in fullscreen. The app will no longer be visible while the user picks a place.

Constant Value: 1 (0x00000001)

#### public static final int MODE_OVERLAY

Mode for launching the autocomplete activity as an overlay. The app will be visible in the background while the user picks a place.

Constant Value: 2 (0x00000002)

#### public static final int RESULT_ERROR

Indicates that an error occurred.

When this result code is returned in `onActivityResult(int, int, Intent)`, you should check the status returned by `getStatus(Context, Intent)`.

##### See Also

- `getStatus(Context, Intent)`

Constant Value: 2 (0x00000002)

## Public Methods

#### public static Place getPlace (Context context, Intent intent)

Returns the `Place` selected by the user.

##### Parameters

context | Your application's context.
intent | The result Intent that was provided in `onActivityResult(int, int, Intent)`.

##### Returns

- The user's selected `Place`.

#### public static Status getStatus (Context context, Intent intent)

Returns the `Status` associated with the result.

The list of possible status codes is available at `PlacesStatusCodes`.

You should pay specific attention to the value of `getStatus(Context, Intent)` when the activity's result code is `RESULT_ERROR`. This can indicate a configuration error (for example, an invalid API key in your Android manifest) or a quota error (see Usage Limits).

##### Parameters

context | Your application's context.
intent | The result Intent that was provided in `onActivityResult(int, int, Intent)`.