Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android地图搜索地址_Android_Google Maps - Fatal编程技术网

Android地图搜索地址

Android地图搜索地址,android,google-maps,Android,Google Maps,在我的Android应用程序中,我正在使用谷歌地图(GoogleMaps),在那里我想搜索一个特定的地址,例如苹果办公室(Apple Office)。所以我找到了当前位置,需要在距离当前位置5公里的范围内搜索Apple Office。所以我的地址已经在谷歌地图上标出了。我知道如何搜索位置 Uri gmmIntentUri = Uri.parse("geo:37.7749,-122.4194"); Intent mapIntent = new Intent(Intent.ACTION_VIEW,

在我的Android应用程序中,我正在使用谷歌地图(GoogleMaps),在那里我想搜索一个特定的地址,例如苹果办公室(Apple Office)。所以我找到了当前位置,需要在距离当前位置5公里的范围内搜索Apple Office。所以我的地址已经在谷歌地图上标出了。我知道如何搜索位置

Uri gmmIntentUri = Uri.parse("geo:37.7749,-122.4194");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
if (mapIntent.resolveActivity(getPackageManager()) != null) {
    startActivity(mapIntent);
}

这将寻找旧金山…但我需要用文本搜索。那么我需要做些什么改变呢?

你必须使用“Android版Google Places API”

嗯。您是否尝试过位置自动完成功能?请按照我已发布的url进行操作。你可以在那里找到样品。检查了吗?还有这个谢谢让我查一下。。。