1

placeautocompletefragmentis deprecated. I need an alternative code for the same. Here's the code sample

PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)
                getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);

        autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {
            @Override
            public void onPlaceSelected(Place place) {
                // TODO: Get info about the selected place.
                destination = place.getName().toString();
                destinationLatLng = place.getLatLng();
            }
            @Override
            public void onError(Status status) {
                // TODO: Handle the error.
            }
        });

1 Answers1

1

Try migrating to com.google.android.libraries.places.widget.AutocompleteSupportFragment

There is more information here https://developers.google.com/places/android-sdk/autocomplete#option_1_embed_an_autocompletesupportfragment

Jaime
  • 378
  • 2
  • 7