F
F
Fakt_372020-05-21 12:37:07
Java
Fakt_37, 2020-05-21 12:37:07

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'

MainActivity
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();
            }
        });


activity_main.xml
<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"/>


accordingly, all this produces as a result
Status{statusCode=PLACES_API_ACCESS_NOT_CONFIGURED, resolution=null}

tell me where to dig?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question