标签:des android style blog io ar color os sp
static final String BOOT_START_PERMISSION = "android.permission.RECEIVE_BOOT_COMPLETED";
public List<Map<String, Object>> fetch_installed_apps(){
List<ApplicationInfo> packages = getPackageManager().getInstalledApplications();
list = new ArrayList<Map<String, Object>>(packages.size());
Iterator<ApplicationInfo> appInfoIterator = packages.iterator();
while (appInfoIterator.hasNext()) {
ApplicationInfo app = (ApplicationInfo) appInfoIterator.next();
//查找安装的package是否有开机启动权限
if(PackageManager.PERMISSION_GRANTED==
getPackageManager().checkPermission(BOOT_START_PERMISSION, app.packageName))
{
String label = getPackageManager().getApplicationLabel(app).toString();
Drawable appIcon = getPackageManager().getApplicationIcon(app);
Map<String, Object> map = new HashMap<String, Object>();
map.put("name", label);
map.put("desc", app.packageName);
map.put("img",appIcon);
list.add(map);
}
}
return list;
}
标签:des android style blog io ar color os sp
原文地址:http://www.cnblogs.com/zuiyirenjian/p/4152219.html