android - Google Places API Picker display Only Certain Types of Places -
i making android app requires user choose place. planning user google places api.link: https://developers.google.com/places/android/
this api gives gives nice way through through place picker. https://developers.google.com/places/android/placepicker
now suppose want show user places of food type (restaurant, hotel etc.) . using places browser api can done adding "type=restraunts" attribute in requests.
is there way show places of types using google places picker android ?
we in 2017 , apparently feature still not implemented yet.
even so, can check type(s) of selected place on activityresult , use it. in case, wanted app accept hospitals , related services, here's code:
@override protected void onactivityresult(int requestcode, int resultcode, intent data) { //... boolean isanhospital = false; selectedplace = placepicker.getplace(this, data); (int : selectedplace.getplacetypes()) { if (i == place.type_doctor || == place.type_health || == place.type_hospital) { isanhospital = true; break; } } if(isanhospital){ //right type of place }else{ //tell user select appropriate place }
hope helps in way. sorry bad english.
Comments
Post a Comment