I have an application package name. Is there any way to get the icon, name of this application ? package name example: com.example.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(); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With