private void refreshList() { if (iFavoritesService == null) { Log.i(TAG, "refreshList iFavoritesService null"); return; } try { List<String> favoritesPackageList = iFavoritesService.getFavoritesMap(); mAppInfoList.clear(); for (String packageName : favoritesPackageList) { ApplicationInfo applicationInfo; try { applicationInfo = mPackageManager.getApplicationInfo(packageName, 0); FavoritesAppInfo appInfo = new FavoritesAppInfo(); appInfo.packageName = applicationInfo.packageName; appInfo.appName = applicationInfo.loadLabel(mPackageManager).toString(); appInfo.appIntent = mPackageManager.getLaunchIntentForPackage(applicationInfo.packageName); appInfo.appIcon = applicationInfo.loadIcon(mPackageManager); mAppInfoList.add(appInfo); } catch (NameNotFoundException e) { e.printStackTrace(); } } } catch (RemoteException e) { e.printStackTrace(); } Intent intent = new Intent(FavoritesModel.ACTION_LOAD_FAVOTITE_SUCCESS); mContext.sendBroadcast(intent); }