gpt4 book ai didi

android - 如何在android中打开导航而不是mapview?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:04:01 26 4
gpt4 key购买 nike

我已经绘制了位置,如果它被点击,它会转到 map 和从 map ,如果它被点击方向,它会打开谷歌导航。是否可以直接与导航链接?

我已经定义了这样的代码。

GeoPoint pt = item.getPoint();

String lat = Double.toString(pt.getLatitudeE6() / 1e6);

String lng = Double.toString(pt.getLongitudeE6() / 1e6);

intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("geo:0,0?q=" + lat + "," + lng));

在uri中,打开导航应该给什么?我想跳过第二张截图,直接

打开导航。如何做到这一点?

我的截图如下:

1st screenshot

2nd screenshot here

3rd screenshot

最佳答案

不过我找到了解决办法

Intent intent;
GeoPoint pt = item.getPoint();
String lat = Double.toString(pt.getLatitudeE6() / 1e6);
String lng = Double.toString(pt.getLongitudeE6() / 1e6);
intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("google.navigation:q=" + lat + "," + lng));

关于android - 如何在android中打开导航而不是mapview?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15426611/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com