如何以编程方式启动特定的应用程序? [英] How do I programmatically launch a specific application?

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

问题描述

我要启动特定应用程序.

I want to launch a specif application.

我知道如何进行Intent,但是如果有多个可以处理Intent的应用程序,我想避免选择菜单,我想直接转到特定的应用程序.希望这是有道理的.

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程序,您可以使用以下

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");

您可能想在未安装应用程序时尝试尝试/捕获ActivityNotFoundException.

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

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

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