本文介绍了Android的 - 开始从ApplicationInfo实例的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个特定的应用程序的ApplicationInfo实例,我怎么能做出一个Intent来启动应用程序?

我试过

 意向意图=新意图(ApplicationInfoInstance.packageName);

但它给出了一个例外。安装该应用程序如此异常是不是因为这一点。

我想我需要使用

  setClassName(字符串的packageName,弦乐的className);

有人能告诉我获得这两个值?
因为大多数我的应用程序的回报 NULL ApplicationInfoInstance.className;

感谢您。


解决方案

There is no such thing as "launch the app" in Android. An "app" may have zero, one, or several activities that are in the launcher and are designed to be launched.

You should be able to use getLaunchIntentForPackage() on PackageManager to get an Intent that meets your needs (or null if there is no such Intent).

这篇关于Android的 - 开始从ApplicationInfo实例的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 00:55