Answer the question
In order to leave comments, you need to log in
How do I upgrade to the new version of Place Autocomlete?
Right now my code looks like
build.gradle
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-places:17.0.0'
implementation 'com.google.android.libraries.places:places:2.2.0'
private PlaceAutocompleteFragment places;
places = (PlaceAutocompleteFragment) getFragmentManager().findFragmentById(R.id.autocomplete_fragment);
places.setOnPlaceSelectedListener(new PlaceSelectionListener() {
@Override
public void onPlaceSelected(Place place) {
if(location_switch.isChecked())
{
getDirection();
}
else
{
Toast.makeText(Welcome.this, "Измените свой статус на Онлайн", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Status status) {
Toast.makeText(Welcome.this, " "+status.toString(), Toast.LENGTH_SHORT).show();
}
});
<fragment
android:id="@+id/autocomplete_fragment"
android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
android:layout_margin="10dp"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="wrap_content"/>
Status{statusCode=PLACES_API_ACCESS_NOT_CONFIGURED, resolution=null}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question