如何以编程方式推出的Andr​​oid特定的应用程序?应用程序、方式、Andr、oid

2023-09-13 23:48:11 作者:伤会慢慢愈合

我想推出一个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程序,你会使用下面的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.