how to start google map for result

喜你入骨 提交于 2020-01-23 01:55:19

问题


I want my user to enter an address. But I want the address to be confirmed with Google Map. So when the user clicks on a button to enter the address, I want to launch an Intent for Google Map where user can enter the address. But then I want the map to return the data to me. How do I do that? If I start my activity as

Uri searchUri = Uri.parse("geo:0,0?z=10&q=");
Intent mapIntent = new Intent(Intent.ACTION_VIEW,searchUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivityForResult(mapIntent,RESULT_CODE_LOCATION);

number one, will it do what I seek? Second: how do I implement onActivityResult? I need the human readable address and the lat-long.

To be clear: I want the user to enter the address through Google Map and then have the address returned to my app.


回答1:


I figure it out. I have to use PlacePicker to accomplish what I seek. https://developers.google.com/places/android-api/placepicker



来源:https://stackoverflow.com/questions/34570445/how-to-start-google-map-for-result

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!