简体   繁体   English

适用于Android的Google Places API自动完成提取数据

[英]Google Places API for Android autocomplete extract data

Is there any way to extract data like city and postcode from the Place object after I select a place in the autocomplete widget. 在自动完成小部件中选择一个位置后,是否有任何方法可以从Place对象中提取城市和邮政编码等数据。 Currently in onActivityResult I only get the Place object on which I have a method getAddress(). 当前在onActivityResult中,我仅获得具有方法getAddress()的Place对象。 But this returns me just a string... 但这只是返回一个字符串...

否。您必须致电api形式的地点详细信息

这是文档https://developers.google.com/places/android-api/autocomplete#option_2_use_an_intent_to_launch_the_autocomplete_activity ,该文档非常清楚地说明了如何获取城市和邮政编码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM