has places api got deprecated 3f 3f 3f

Solutions on MaxInterview for has places api got deprecated 3f 3f 3f by the best coders in the world

showing results for - "has places api got deprecated 3f 3f 3f"
Giovanni
21 Oct 2018
1// Set the fields to specify which types of place data to return.
2List<Place.Field> fields = Arrays.asList(Place.Field.ID, Place.Field.NAME);
3// Start the autocomplete intent.
4Intent intent = new Autocomplete.IntentBuilder(
5        AutocompleteActivityMode.FULLSCREEN, fields)
6        .build(this);
7startActivityForResult(intent, AUTOCOMPLETE_REQUEST_CODE);
8
9@Override
10protected void onActivityResult(int requestCode, int resultCode, Intent data) {
11    if (requestCode == AUTOCOMPLETE_REQUEST_CODE) {
12        if (resultCode == RESULT_OK) {
13            Place place = Autocomplete.getPlaceFromIntent(data);
14            Log.i(TAG, "Place: " + place.getName() + ", " + place.getId());
15        } else if (resultCode == AutocompleteActivity.RESULT_ERROR) {
16            // TODO: Handle the error.
17            Status status = Autocomplete.getStatusFromIntent(data);
18            Log.i(TAG, status.getStatusMessage());
19        } else if (resultCode == RESULT_CANCELED) {
20            // The user canceled the operation.
21        }
22    }
23}
Luca
12 Jun 2019
1 // Add an import statement for the client library.
2    import com.google.android.libraries.places.api.Places;
3
4    // Initialize Places.
5    Places.initialize(getApplicationContext(), "***YOUR API KEY***");
6
7   // Create a new Places client instance.
8   PlacesClient placesClient = Places.createClient(this);