我想获得我的所有安装的应用程序图标..我能得到,使用包管理器图标?有什么作用呢?或任何其他方式获得的位图所有已安装的应用程序的图标?
谢谢, 杰伊·帕特尔
解决方案 尝试{
字符串PKG =com.app.my; //你的包名
可绘制图标=的getContext()getPackageManager()getApplicationIcon(PKG)。
imageView.setImageDrawable(图标);
}
赶上(PackageManager.NameNotFoundException NE)
{
}
检查这里了解更多详情。
I wanna get icons of my all installed apps.. Can i get that icons using package manager? Is there any function for it? or any other way to get icons of all installed apps in bitmap?
Thanks, Jay Patel
解决方案try{
String pkg = "com.app.my";//your package name
Drawable icon = getContext().getPackageManager().getApplicationIcon(pkg);
imageView.setImageDrawable(icon);
}
catch (PackageManager.NameNotFoundException ne)
{
}
Check here for more details.