Liste der installierten Apps

Aus Thoms Wiki
Zur Navigation springenZur Suche springen
final PackageManager pm = getPackageManager();
// get a list of installed apps.
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
 

for (ApplicationInfo packageInfo : packages) {
   System.out.println("Installed package :" + packageInfo.packageName);
   System.out.println("Launch Activity :" + pm.getLaunchIntentForPackage(packageInfo.packageName));
}
// the getLaunchIntentForPackage returns an intent that you can use
// with startActivity()
 
// TAKEN FROM http://stackoverflow.com/questions/2695746/how-to-get-a-list-of-installed-android-applications-and-pick-one-to-run