-2

I want to show a specific app's icon from my installed apps, not every apps icon.

First I want to check if that package is installed or not, to do that I got help from the answers of this question-
How to check programmatically if an application is installed or not in Android?

Then if that package is installed, I want to show that package's app icon in my application and want to launch it by tapping on it.

Please help! Thanks in advance.

  • Which parts are you having issues with? Did you come across the `PackageManager#getApplicationIcon()` and `PackageManager#getLaunchIntentForPackage()` methods in your research? Are you having trouble linking those to a `Button`, or `ImageButton`, or something? – Mike M. Nov 18 '19 at 02:40

1 Answers1

2

You can get it from PackageManager.

Drawable appIcon = getPackageManager().getApplicationIcon("apps.package.name");

check the below link https://developer.android.com/reference/android/content/pm/PackageManager.html

You can add a click event with intent to start the new app.

Jacks
  • 803
  • 1
  • 6
  • 16