根据包名获取应用图标和名称

xiaoxiao2021-02-27  328

private Drawable getIcon(String pakgename) { PackageManager pm = getPackageManager(); try { appInfo = pm.getApplicationInfo(pakgename, PackageManager.GET_META_DATA); // // // 应用名称 // pm.getApplicationLabel(appInfo) //应用图标 appIcon = pm.getApplicationIcon(appInfo); return appIcon; } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } return null; }
转载请注明原文地址: https://www.6miu.com/read-3724.html

最新回复(0)