是否可以将Google地图网址打开到外部网络浏览器中?

时间:2017-10-17 05:57:57

标签: android google-maps webbrowser-control

是否可以将带有latlng值的Google地图网址打开到外部网络浏览器中?

目前我使用的是简单的Intent,但它已打开到谷歌地图中,​​请尽可能帮助我。

1 个答案:

答案 0 :(得分:0)

您可以使用:

String url = "http://maps.google.com/maps?q=loc:23.070791,72.520004";
        Uri uri = Uri.parse(url);
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setData(uri);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setPackage("com.android.chrome");
        startActivity(intent);

我希望这会有所帮助

相关问题