我想在我的列表视图中添加来自getPackageManager
. 我尝试了类似的东西:
try {
// Icon
Drawable icon = pm.getApplicationIcon(info.processName);
Drawable default_icon = pm.getDefaultActivityIcon();
CharSequence c = pm.getApplicationLabel(pm.getApplicationInfo(info.processName, PackageManager.GET_META_DATA));
Log.w("LABEL", "Name" + c.toString());
String pName = info.processName;
adapter.add(icon + c.toString().toUpperCase() + "\n" + info.processName);
}
但它只返回一个字符串。如果可能的话,我想要图标而不是字符串。这可能吗?