在Android上通过Intent启动Huawei Petal Maps Directions [英] Launching Huawei Petal Maps Directions via Intent on Android
本文介绍了在Android上通过Intent启动Huawei Petal Maps Directions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能像谷歌地图一样使用意图启动从A点到B点导航的华为花瓣地图?如果是,怎么办?
Is it possible to launch Huawei Petal Maps with navigation from point A to point B using intent just like in google maps? If yes, how?
推荐答案
是的,您可以使用意图启动花瓣图"应用程序,然后在该应用程序中使用导航功能.
Yes, you can use an intent to launch the Petal Map app, and then use navigation functions in the app.
- 深层链接示例:
mapapp://navigation?saddr=xxx&daddr=xxx&language=xx&type=xxx
mapapp://navigation?saddr=home&daddr=company&language=en&type=drive
mapapp://navigation?type=exit
- 要使用此功能,您需要将 uriString 设置为以下内容:
- To use this function, you need to set uriString to the following:
"mapapp://navigation?saddr=25.102916,55.165363&daddr=25.164610000000,55.228869000000&language=en&type=drive"
- 修改后的示例代码:
String uriString = "mapapp://navigation?saddr=25.102916,55.165363&daddr=25.164610000000,55.228869000000&language=en&type=drive";
Uri content_url = Uri.parse(uriString);
Intent intent = new Intent(Intent.ACTION_VIEW, content_url);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
For more details, see docs.
这篇关于在Android上通过Intent启动Huawei Petal Maps Directions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文