Skip to content

Instantly share code, notes, and snippets.

@javipacheco
Created August 6, 2014 09:43
Show Gist options
  • Save javipacheco/1704760e53859bfda63d to your computer and use it in GitHub Desktop.
Save javipacheco/1704760e53859bfda63d to your computer and use it in GitHub Desktop.
Find Installed Apps
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