Use the App name opener (activity) and then use the intent action to open an app.
Idea: Prime Minister get a list of app apps installed on your phone, then select one of the apps and use intent to open it.
The source code is as follows:
|
Packagemanager Packagemanager = stbnetserveractivity. this. Getpackagemanager ();
//Get a list of apps in your phone
list<packageinfo> pInfo = packagemanager.getinstalledpackages (0);
for (int i = 0; i < pinfo.size (); i++)
{
PackageInfo p = pinfo.get (i);
//Get the label information in the <application> of the relevant package, which is the name of the application
String label = Packagemanager.getapplicationlabel (P.applicationinfo). toString ();
SYSTEM.OUT.PRINTLN (label);
if (Label.equals (PackageName)) { //Compare label
String pName = p.packagename; //Get package name
Intent Intent = new Intent ();
//Get Intent
Intent =packagemanager.getlaunchintentforpackage (PName);
StartActivity (Intent);
}
}
|
Start another app with the app's activity name