Get a list of every launcher in Android

Daniel Nord picture Daniel Nord · May 30, 2011 · Viewed 7.4k times · Source

In my application I want to show a list of every available launcher (for homescreen) on that specific Android phone. Is it possible to get some kind of information from Android OS and how do I make this call?

Thanks!

Kind regards Daniel

Answer

Fede picture Fede · Jan 4, 2012

You can query the list of ResolverInfo that match with a specific Intent. The next snippet of code print all installed launchers.

PackageManager pm = getPackageManager();
Intent i = new Intent(Intent.ACTION_MAIN);
i.addCategory(Intent.CATEGORY_HOME);
List<ResolveInfo> lst = pm.queryIntentActivities(i, 0);
for (ResolveInfo resolveInfo : lst) {
    Log.d("Test", "New Launcher Found: " + resolveInfo.activityInfo.packageName);
}