I want to ask how to get nearby Places with filter type (Example: shopping mall, bank) from new google places api (https://developers.google.com/places/android/start)
Here my code (I already add some alternative in loop conditions), but I want to filter types from PlaceFilter not in loop conditions.
PendingResult<PlaceLikelihoodBuffer> result = Places.PlaceDetectionApi
.getCurrentPlace(mGoogleApiClient, null);
result.setResultCallback(new ResultCallback<PlaceLikelihoodBuffer>() {
@Override
public void onResult(PlaceLikelihoodBuffer likelyPlaces) {
for (PlaceLikelihood placeLikelihood : likelyPlaces) {
list = placeLikelihood.getPlace().getPlaceTypes();
for(int i = 0; i < list.size(); i++)
{
if(list.get(i) == Place.TYPE_SHOPPING_MALL) {
Log.i(TAG, String.format("Place '%s' has likelihood: %g",
placeLikelihood.getPlace().getName(),
placeLikelihood.getLikelihood()));
}
}
}
likelyPlaces.release();
}
});
Please help, Many thanks