Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.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_Firebase_Android Recyclerview_Maps - Fatal编程技术网

Android 如何在谷歌地图上标记特定位置?

Android 如何在谷歌地图上标记特定位置?,android,firebase,android-recyclerview,maps,Android,Firebase,Android Recyclerview,Maps,我正在创建一个以Firebase为后端的旅游应用程序。我需要知道如何在一个特定的位置使用标记 Intent i=new Intent(Intent.ACION\u视图)像这样,或者有其他方法可以处理上面的标记吗?尝试使用此示例启动具有特定Lat和Lng的google地图 public void gotToLocation(String markerName,Float latitude, Float longitude ) { String uri = String.format(Loc

我正在创建一个以Firebase为后端的旅游应用程序。我需要知道如何在一个特定的位置使用标记


Intent i=new Intent(Intent.ACION\u视图)
像这样,或者有其他方法可以处理上面的标记吗?

尝试使用此示例启动具有特定Lat和Lng的google地图

public void gotToLocation(String markerName,Float latitude, Float longitude ) {
    String uri = String.format(Locale.ENGLISH, "geo:0,0?q=%f,%f(%s)", latitude,longitude,markerName);
    Intent mapIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));;
    mapIntent.setPackage("com.google.android.apps.maps");
    if (mapIntent.resolveActivity(getActivity().getPackageManager()) != null) {
        startActivity(mapIntent);
    }
}
那就这样说吧

gotToLocation("MyLocation",34.99,-106.61);

您好,您可以使用谷歌文档。


上面的示例在谷歌悉尼办事处的位置显示了一个标签

谢谢兄弟,我会试试这个,然后告诉你Hanks兄弟,我会试试这个,然后告诉你
Uri gmmIntentUri = Uri.parse("geo:0,0?q=-33.8666,151.1957(Google+Sydney)");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);