If I have an ApplicationInfo instance of a particular app, how can I make an Intent to launch the app?
I tried
Intent intent = new Intent(ApplicationInfoInstance.packageName);
but it gives an exception. The app is installed so the exception is not due to that.
I think I need to use
setClassName (String packageName, String className);
Could someone direct me to obtain these two values?
Because most of my apps returns NULL for ApplicationInfoInstance.className;
Thank you.
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()onPackageManagerto get anIntentthat meets your needs (or null if there is no suchIntent).