1

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?

AlbeyAmakiir
  • 2,217
  • 6
  • 25
  • 48

1 Answers1

2

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 );
Community
  • 1
  • 1
Adil Soomro
  • 37,609
  • 9
  • 103
  • 153