如何以编程方式推出的Andr​​oid特定的应用程序? [英] How do I programmatically launch a specific application in Android?

查看:142
本文介绍了如何以编程方式推出的Andr​​oid特定的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想推出一个specif应用。 我知道该怎么做意图,但我想避免的选择菜单,如果有多个应用程序可以处理这个意图,我想直接去一个特定的应用程序。希望这是有道理的。

I want to launch a specif application. I know how to do Intents but I want to avoid the selection menu if there are multiple apps that can handle the intent, i want to go directly to a particular app. Hope this makes sense.

推荐答案

您直接使用包名/类,例如创建一个新的意图调用twidroid程序,你会使用下面的<一个href="http://snipplr.com/view/10688/use-twidroids-public-intent-to-send-twitter-messages-from-your-own--android-application/">link文字:

You use the package name / class directly, for example to create a new intent to call the twidroid program you'd use the followinglink text:

 Intent intent = new Intent("com.twidroid.SendTweet");

您很可能希望把一个try / catch绕了ActivityNotFoundException未安装应用程序时进行。

You'd probably want to put a try/catch around for a ActivityNotFoundException for when the application is not installed.

这篇关于如何以编程方式推出的Andr​​oid特定的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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