如何在Android开放的导航,而不是图形页面? [英] How to open navigation instead of mapview in android?

查看:214
本文介绍了如何在Android开放的导航,而不是图形页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经绘制位置,如果已被点击它,它去地图和地图从,如果被点击的方向,它会打开谷歌navigation.Is,可以直接导航链接?

I have plotted location and if it has been clicked, it goes to maps and from maps, if it has been clicked direction, it opens google navigation.Is it possible to directly link with navigation?

我已经定义了code这样。

I have defined the code like this.

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,应该怎样给打开导航?我想跳过第2截图并直接

In uri, what should be given to open navigation? I want to skip 2nd screenshot and directly

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

open navigation. how to do this?

我的截图如下:

推荐答案

不过,我找到了解决办法。

However I found a solution

意图意图;

的GeoPoint PT = item.getPoint();

GeoPoint pt = item.getPoint();

字符串纬度= Double.toString(pt.getLatitudeE6()/ 1e6个电子);

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

字符串LNG = Double.toString(pt.getLongitudeE6()/ 1e6个电子);

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

意图=新意图(android.content.Intent.ACTION_VIEW,
Uri.parse(google.navigation:Q =+纬度+,+ LNG));

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

这篇关于如何在Android开放的导航,而不是图形页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆