0

My code

SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(ViewProperty.this);


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

        autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {
            @Override
            public void onPlaceSelected(Place place) {
                mMap.clear();
                mMap.addMarker(new MarkerOptions().position(place.getLatLng()).title(place.getName().toString()));
                mMap.moveCamera(CameraUpdateFactory.newLatLng(place.getLatLng()));
                mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(place.getLatLng(), 12.0f));
            }

            @Override
            public void onError(Status status) {
                Log.w("myApp", status.toString());
            }
        });

Error :

:InputMethodManager: startInputInner : InputBindResult == null need restart W/myApp: Status{statusCode=PLACES_API_ACCESS_NOT_CONFIGURED, resolution=null}
AskNilesh
  • 67,701
  • 16
  • 123
  • 163

2 Answers2

1

You have to initialize google places first

if (!Places.isInitialized()) {
      Places.initialize(context, "GOOGLE PLACES API KEY HERE")
  }
0