AI-generated Key Takeaways
-
This class and the Google Play Services Places SDK are deprecated, and a new SDK is available.
-
The Place Picker UI is a dialog allowing users to pick a Place using an interactive map.
-
Users can select their current location or a nearby place, and apps can initialize the map viewport.
-
The class includes methods to retrieve the selected Place, the map's viewport, and deprecated methods for attributions.
This class is deprecated.
The Google Play Services Places SDK is deprecated. A new SDK is available.
See the client
migration guide for more information.
The Place Picker UI is a dialog that allows a user to pick a Place using
an interactive map.
Users can select their current location, or a nearby place. Apps can also initialize the map to a particular viewport. See the developer's guide for more details.
Nested Class Summary
| class | PlacePicker.IntentBuilder | Builder for a Place Picker launch intent. | |
Constant Summary
| int | RESULT_ERROR | Indicates that an unspecified error occurred. |
Public Method Summary
| static String | |
| static LatLngBounds |
getLatLngBounds(Intent
intent)
Returns the viewport of the map at the time the user's selection was made.
|
| static Place | |
| static Place |
getPlace(Intent
intent, Context
context)
This method is deprecated. Use
getPlace(Context, Intent) instead.
|
Inherited Method Summary
Constants
public static final int RESULT_ERROR
Indicates that an unspecified error occurred.
If you encounter this error when developing your application, you may find it useful
to examine the ERROR logs for the 'Places' tag. See
isLoggable(String, int) for information on how to enable this log level.
Public Methods
public static String getAttributions (Intent intent)
This method is deprecated.
Use getAttributions()
Returns the attributions to be shown to the user if data from the selected
Place
is used.
We recommend placing this information below any place information. See Displaying Attributions for more details.
Parameters
| intent | The result Intent that was provided in
onActivityResult(int, int, Intent). |
|---|
Returns
- The attributions in HTML format, or null if there are no attributions to display.
public static LatLngBounds getLatLngBounds (Intent intent)
Returns the viewport of the map at the time the user's selection was made.
Parameters
| intent | The result Intent that was provided in
onActivityResult(int, int, Intent). |
|---|
Returns
- A
LatLngBoundsrepresenting the map's viewport, or null if the user did not make a selection.
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, or null if no selection was made.
public static Place getPlace (Intent intent, Context context)
This method is deprecated.
Use
getPlace(Context, Intent) instead.
Returns the Place
selected by the user.
Parameters
| intent | The result Intent that was provided in
onActivityResult(int, int, Intent). |
|---|---|
| context | Your application's context. |
Returns
- The user's selected
Place, or null if no selection was made.