@Override protected List<AppInfo> doInBackground(Void... params) { List<AppInfo> appInfoList = mAppManager.getAppInfoList(); if (null == appInfoList || appInfoList.size() == 0) { setToastTxt(SearchActivity.this.getResources().getString(R.string.first_in_init_app_list)); appInfoList = APPUtils.getAppInfoList(SearchActivity.this); mAppManager.addAppInfoList(appInfoList); } return appInfoList; }
@Override protected List<AppInfo> doInBackground(Void... params) { List<AppInfo> localAppInfoList = APPUtils.getAppInfoList(SearchActivity.this); List<AppInfo> savedAppInfoList = mAppManager.getAppInfoList(); List<AppInfo> deleteAppInfoList = getDeleteAppInfoList(savedAppInfoList, localAppInfoList); if (!isListEmpty(deleteAppInfoList)) { mAppManager.deleteAppInfoList(deleteAppInfoList); } List<AppInfo> updateAppInfoList = getUpdateAppInfoList(savedAppInfoList, localAppInfoList); if (!isListEmpty(updateAppInfoList)) { mAppManager.addAppInfoList(updateAppInfoList); } return mAppManager.getAppInfoList(); }