如何从ResolveInfo启动Intent

时间:2012-09-20 01:20:27

标签: android android-intent launcher

我正在尝试为Android制作一个自定义启动器,我正在试图找出如何启动我的不同应用程序。我认为这样做的方式是意图,我在这里发现了一个帖子:

Open another application from your own (intent)

我真的不明白答案!有人可以给我一个简洁的片段或一系列步骤,从单个ResolveInfo到启动ResolveInfo所代表的应用程序吗?

2 个答案:

答案 0 :(得分:43)

给定名为ResolveInfo的{​​{1}}:

launchable

(来自https://github.com/commonsguy/cw-omnibus/tree/master/Introspection/Launchalot

答案 1 :(得分:20)

通过这种方式创建一个新的Intent。

    Intent intent = new Intent();
    intent.setClassName(resolveInfo.activityInfo.applicationInfo.packageName,
            resolveInfo.activityInfo.name);
    startActivity(intent);