如何发动所有的​​地图应用程序的Andr​​oid意图 [英] How launch all maps app android intent

查看:184
本文介绍了如何发动所有的​​地图应用程序的Andr​​oid意图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过故意打开所有的地图应用程序。

我试了一下,应用程序崩溃,其目的不开

 意图myIntent =新意图(android.intent.category.APP_MAPS);
    startActivity(myIntent);


解决方案

 意向意图=新意图(android.content.Intent.ACTION_VIEW,
    Uri.parse(http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345));
startActivity(意向);

试试这个。

I want to open all the maps app through intent.

I tried it, and the app crashes, the intent doesn't open

    Intent myIntent = new Intent("android.intent.category.APP_MAPS");
    startActivity(myIntent);

解决方案

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
    Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345"));
startActivity(intent);

Try this.

这篇关于如何发动所有的​​地图应用程序的Andr​​oid意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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