Created
August 6, 2014 09:43
-
-
Save javipacheco/1704760e53859bfda63d to your computer and use it in GitHub Desktop.
Find Installed Apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); | |
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); | |
final List<ResolveInfo> apps = packageManager.queryIntentActivities(mainIntent, 0); | |
final int countApps = apps.size(); | |
for (int i = 0; i < countApps; i++) { | |
try { | |
ResolveInfo info = apps.get(i); | |
String label = (String) info.loadLabel(packageManager) | |
icon = info.activityInfo.icon | |
} catch (Exception e) { | |
Crashlytics.logException(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment