In order to reduce the number of API calls, I'm trying to query place details by passing several place_ids at a time (up to 10). I haven't found any useful information beyond the docs.
Notably, the constructor is:
public abstract PendingResult<PlaceBuffer> getPlaceById (GoogleApiClient client, **String... placeIds**)
and the doc says: Returns Place objects for each of the given place IDs.
I don't have any problem when passing a single place_id
, but when I pass a comma delimted string of id's, all of which are known to be good, I get a status = "SUCCESS"
but a buffer count of 0.
Does anyone know the correct way to pass multiple id's to getPlaceById()
?
Here's my code if that helps at all:
Places.GeoDataApi.getPlaceById(mGoogleApiClient, searchIds)
.setResultCallback(new ResultCallback<PlaceBuffer>() {
@Override
public void onResult(PlaceBuffer places) {
int cnt = places.getCount();
if (places.getStatus().isSuccess() && places.getCount() > 0) {
for (int i=0; i < places.getCount(); i++) {
final Place myPlace = places.get(i);
Log.d("<< cache >> ", "Place found: " + myPlace.getName());
}
} else {
Log.d("<< cache >> ", "Place not found");
}
places.release();
}
});