如何获得其他应用程序的图标(安卓) [英] How to get the icon of other applications (Android)

查看:227
本文介绍了如何获得其他应用程序的图标(安卓)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做的是让所有的手机上当前正在运行的进程的列表。这是我所做,

What I'm doing is getting a list of all the current running processes on the phone. Which I have done by,

private List<RunningAppProcessInfo> process;
private ActivityManager activityMan;
...
activityMan = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
process = activityMan.getRunningAppProcesses();

这工作正常。当我打电话processName场像

this works fine. When I call the processName field like

process.get(i).processName;

我得到这样com.android.mail例如名称。

I get a name like com.android.mail for example.

我想要做的就是用这个来获得访问该应用程序,这样我可以显示其对用户的图标,但我不能找到任何东西,让我做到这一点。有什么可以帮助我吗?

what I'm trying to do is use this to get access to that application so I can display its icon to the user, but I cant find anything that lets me do this. Is there something that can help me?

我在我的英雄测试该应用程序,以便在API级别为3(Android 1.5的)。

I'm testing this app on my hero so the api level is 3 (android 1.5).

感谢。

推荐答案

好吧,我想通了,如何做到这一点。如果你好奇,这就是我所做的。

Ok, I figured out how to do it. In case your curious this is what I did.

private PackageManager pk;
pk = getPackageManager();
....
pk.getApplicationIcon(process.get(i).processName)

感谢。

这篇关于如何获得其他应用程序的图标(安卓)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆