PlaceAutoComplete onClick Error
PlaceAutoComplete onClick Error
I'm using google Maps in a fragment and on top of it I'm using PlaceAutoComplete fragment. The problem I'm facing is that when I click on the PlaceAutoComplete widget it shows me a error.
Code:
placeAutoComplete.setOnPlaceSelectedListener(new PlaceSelectionListener() {
@Override
public void onPlaceSelected(Place place) {
Log.d("Maps", "Place selected: " + place.getName());
addMarker(place);
}
@Override
public void onError(Status status) {
Toast.makeText(getContext(),"Erro",Toast.LENGTH_SHORT).show();
Log.d("Maps", "An error occurred: " + status);
}
});
Error:
Status{statusCode=ERROR, resolution=null}
New Error:
{"errors":[{"domain":"global","reason":"forbidden","message":"Requests
to this API placesandroid method places.
PlacesService.AutocompleteWidget are blocked."}],"code":403}P
1 Answer
1
Enable the Places API in Google Developers Console (https://console.developers.google.com/).
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Possible duplicate of Google Place Api: Requests from this Android client application com.package.name are blocked
– LieForBananas
Jun 29 at 16:25