AlbeyAmakiir
AlbeyAmakiir

Reputation: 2247

How do you run an external app when all you know is the package name?

At runtime, I have the package name of an app I want to run, but I don't have the main class name. I don't have even the package name before runtime (it's based on user choice). From what I've found, it seems as though you need the main class name to run an app. Is there a way to get the info I need to run an external app from the package name alone? Can I run it only using that?

Upvotes: 1

Views: 137

Answers (1)

Adil Soomro
Adil Soomro

Reputation: 37729

Detailed discussion here and here

If you have package name and don't know the name of main activity you will use something like:

Intent in = getPackageManager().getLaunchIntentForPackage("com.another.package");
startActivity( in );

Upvotes: 2

Related Questions