I am working on an app were I am going to open other apps. The only problem is that I do not know how to refer to third party apps. I am planing to use an intent. Can you refer to it useing only the packagename, or do you need the Main Activity intent. Are there any simple ways of finding the right intent, and then refer to it.
Share
I am interpreting this as meaning that you are creating a launcher, akin to the ones found on home screens.
Launchers use an
ACTION_MAIN/CATEGORY_LAUNCHERIntent.Use
PackageManagerto find all the possibleACTION_MAIN/CATEGORY_LAUNCHERactivities on the device, and then display those to the user to choose from. You can then construct a suitableIntentfor starting up their specific choice.Here is a sample project that implements a launcher.
To come up with the list of things that could be launched, that sample app uses:
And here is the actual launching logic, based upon the user clicking on one of those “launchables” in a
ListActivity: