Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Icon from another android Application

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.google.maps";

Drawable googleIcon = googlePackageName.getIconLauncher() or something.
like image 716
Naskov Avatar asked Nov 28 '12 15:11

Naskov


2 Answers

Use PackagerManager's getApplicationIcon() for this task:

Drawable appIcon = getPackageManager().getApplicationIcon("com.google.maps");
like image 136
Marcin Orlowski Avatar answered Sep 29 '22 16:09

Marcin Orlowski


I came across this question. Never heard of before. But I guess this should be the solution:

Drawable icon = context.getPackageManager().getApplicationIcon(packageName);
like image 40
Terril Thomas Avatar answered Sep 29 '22 15:09

Terril Thomas