如何以编程方式显示 android 上已安装应用程序的特定应用程序图标?

How to show a specific app's icon from the installed apps on android programmatically?

我想显示我安装的应用程序中特定应用程序的图标,而不是每个应用程序的图标。

首先我想检查是否安装了那个包,为此我从这个问题的答案中得到了帮助-
How to check programmatically if an application is installed or not in Android?

然后,如果安装了该软件包,我想在我的应用程序中显示该软件包的应用程序图标,并希望通过点击它来启动它。

请帮忙!提前致谢。

您可以从 PackageManager 获取它。

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

检查下面的 link https://developer.android.com/reference/android/content/pm/PackageManager.html

您可以添加点击事件以启动新应用。