I want to get details of places (cityName, ZipCode, etc) from predictions that I get from Autocomplete Places service. My code is like the following:
Places.GeoDataApi.getAutocompletePredictions(googleApiClient, query, bounds, null)
.setResultCallback(
new ResultCallback<AutocompletePredictionBuffer>() {
@Override
public void onResult(AutocompletePredictionBuffer buffer) {
if (buffer == null)
return;
if (buffer.getStatus().isSuccess()) {
for (AutocompletePrediction prediction : buffer) {
// How to get cityName here
}
}
buffer.release();
}
}, 15, TimeUnit.SECONDS);
Is this possible? How can I implement it? If I look for place details by placeId, I can't get that I want neither:
Places.GeoDataApi.getPlaceById(googleApiClient, placeId)
.setResultCallback(new ResultCallback<PlaceBuffer>() {
@Override
public void onResult(PlaceBuffer places) {
if (places.getStatus().isSuccess()) {
// How to get cityName here
}
places.release();
}
});