PlacePicker | 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 | Constants | Ctors | Methods | Inherited Methods | [Expand All]
public class

# PlacePicker

extends Object

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

## Class Overview

The Place Picker UI is a dialog that allows a user to pick a `Place` using an interactive map.

Users can select the place they are at, or a place nearby. Apps can also initialize the map to a particular viewport.

## Summary

Nested Classes
class | PlacePicker.IntentBuilder | Builder for a Place Picker launch intent.

Constants
int | RESULT_ERROR | Indicates that an error occurred.

Public Constructors
| PlacePicker()

Public Methods
static String | getAttributions(Intent intent) Returns an HTML string with required attributions that must be shown whenever the data in the selected `Place` is used.
static LatLngBounds | getLatLngBounds(Intent intent) Returns the last `LatLngBounds` of the map if a selection was made.
static Place | getPlace(Intent intent, Context context) Retrieves the selected `Place` from the result intent.

[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()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Constants

#### public static final int RESULT_ERROR

Indicates that an error occurred.

Constant Value: 2 (0x00000002)

## Public Constructors

#### public PlacePicker ()

## Public Methods

#### public static String getAttributions (Intent intent)

Returns an HTML string with required attributions that must be shown whenever the data in the selected `Place` is used. Please refer to the developer's guide for more information about attribution. One easy way to render this content is with a TextView:

         String attributions = PlacePicker.getAttributions(selectedPlace);
         TextView attributionsTextView = findViewById(R.id.attributions);
         attributionsTextView.setText(Html.fromHtml(attributions))

#### public static LatLngBounds getLatLngBounds (Intent intent)

Returns the last `LatLngBounds` of the map if a selection was made.

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

Retrieves the selected `Place` from the result intent.

##### Returns

- The selected `Place` or null if no selection was made