How do I get to the Icon Launcher from another Android application on the device if I know its Package Name?
Example
String googlePackageName = \"com.go
Use PackagerManager's getApplicationIcon() for this task:
Drawable appIcon = getPackageManager().getApplicationIcon("com.google.maps");
I came across this question. Never heard of before. But I guess this should be the solution:
Drawable icon = context.getPackageManager().getApplicationIcon(packageName);
The following snipped should point you in the right direction:
final Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setPackage( packageName );
final List<ResolveInfo> pkgAppsList = pm.queryIntentActivities( intent, 0 );
if( pkgAppsList.size() > 0 ) {
this.url = pkgAppsList.get(0).activityInfo.name;
icon = pkgAppsList.get(0).activityInfo.loadIcon( pm );
this.displayName = pkgAppsList.get(0).activityInfo.loadLabel( pm ).toString();
this.module = pkgAppsList.get(0).activityInfo.packageName;
this.isExternal = true;
this.count = count;
}