Get Application Info from package name
Try something like:
try {
ApplicationInfo app = this.getPackageManager().getApplicationInfo("com.example.name", 0);
Drawable icon = packageManager.getApplicationIcon(app);
String name = packageManager.getApplicationLabel(app);
return icon;
} catch (NameNotFoundException e) {
Toast toast = Toast.makeText(this, "error in getting icon", Toast.LENGTH_SHORT);
toast.show();
e.printStackTrace();
}