如何启动谷歌地图的结果 [英] how to start google map for result
问题描述
我希望我的用户输入一个地址.但我想用Google Map确认地址.因此,当用户单击按钮输入地址时,我想启动一个Google Map Intent,用户可以在其中输入地址.但是然后我希望地图将数据返回给我.我怎么做?如果我以以下身份开始活动
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);
第一,它会做我所追求的吗?第二:如何实现onActivityResult
?我需要可读的地址和经纬度.
number one, will it do what I seek? Second: how do I implement onActivityResult
? I need the human readable address and the lat-long.
请注意:我希望用户通过Google Map输入地址,然后将地址返回给我的应用.
推荐答案
我知道了.我必须使用PlacePicker来完成我所寻求的. https://developers.google.com/places/android-api/placepicker
I figure it out. I have to use PlacePicker to accomplish what I seek. https://developers.google.com/places/android-api/placepicker
这篇关于如何启动谷歌地图的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!