I'm migrating from the old Android Places API to either the new one or the compatibility library, in both approaches the auto prediction search works, but getting more details from the ID of the selected location appears to never complete.
I started with the compatibility library, the initial autoPrediction lookup works as expected. Suggesting the API key and account are fine. But getPlaceByID failed to finish.
I've switched to the new API instead, again, the new FindAutocompletePredictions works, but the fetchPlaces task never finishes.
I've boiled the code down to manually putting an ID in, only asking for LatLong, and having all the available listeners with breakpoints. They are never hit.
List<Place.Field> placeFields = Arrays.asList(Place.Field.LAT_LNG);
FetchPlaceRequest request = FetchPlaceRequest.builder("EhtHbGFzZ293IFN0cmVldCwgR2xhc2dvdywgVUsiLiosChQKEgmvXKElzUWISBFN3LArF1aEERIUChIJqZHHQhE7WgIReiWIMkOg-MQ", placeFields)
.build();
placesClient.fetchPlace(request).addOnCompleteListener(new OnCompleteListener<FetchPlaceResponse>() {
@Override
public void onComplete(@NonNull Task<FetchPlaceResponse> task) {
System.out.println("");
}
}).addOnCanceledListener(new OnCanceledListener() {
@Override
public void onCanceled() {
System.out.println("");
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
System.out.println("");
}
}).addOnSuccessListener(new OnSuccessListener<FetchPlaceResponse>() {
@Override
public void onSuccess(FetchPlaceResponse fetchPlaceResponse) {
System.out.println("");
}
});
I would expect to hit one of the listeners and see a place, or some reason for it to fail. Or, at least something in the logcat to say what's going on.