Launch an application from another application on Android


Question

I want to launch an installed package from my Android application. I assume that it is possible using intents, but I didn't find a way of doing it. Is there a link, where to find the information?

1
444
7/20/2014 12:22:33 PM

If you don't know the main activity, then the package name can be used to launch the application.

Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
if (launchIntent != null) { 
    startActivity(launchIntent);//null pointer check in case package name was not found
}
668
7/6/2016 1:20:18 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon