Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我正在制作任务杀手,我需要能够
获取所有当前正在运行的进程的图标
把它全部列出来ListView
ListView
我想出了如何找到所有正在运行的进程的名称,但我似乎无法弄清楚如何获取图标。
PackageManager能帮你。它有一个名为 的方法GetApplicationIcon,它接受一个你应该已经拥有的包名,并给你一个ImageDrawable你可以加载到任何View.
PackageManager
GetApplicationIcon
ImageDrawable
View
IE:
var icon = PackageManager.GetApplicationIcon("com.example.someapp"); imageView.setImageDrawable(icon);