@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View frame = inflater.inflate(R.layout.systemappuninstall, null); mListView = (ListView) frame.findViewById(R.id.sys_listview); mListView.addHeaderView(inflater.inflate(R.layout.systemappuninstallheader, null)); mAdapter = new SystemAppUninstallAdapter(mHandler); mListView.setAdapter(mAdapter); mAdapter.update(((AppUninstallActivity) getActivity()).mSystemappInfo); return frame; }
@Override public void onResume() { super.onResume(); // 检查应用是否被冻结 List<AppUninstallBean> list = new ArrayList<AppUninstallBean>(); for (AppUninstallBean bean : ((AppUninstallActivity) getActivity()).mSystemappInfo) { if (AppFreezer.isAppFreeze(getActivity(), bean.packname)) { continue; } list.add(bean); } ((AppUninstallActivity) getActivity()).mSystemappInfo.clear(); ((AppUninstallActivity) getActivity()).mSystemappInfo.addAll(list); mAdapter.update(((AppUninstallActivity) getActivity()).mSystemappInfo); }
public void handleMessage(android.os.Message msg) { if (msg.obj instanceof String) { String packageName = (String) msg.obj; List<AppUninstallBean> list = new ArrayList<AppUninstallBean>(); for (AppUninstallBean bean : ((AppUninstallActivity) getActivity()).mSystemappInfo) { if (packageName.equals(bean.packname)) { continue; } list.add(bean); } ((AppUninstallActivity) getActivity()).mSystemappInfo.clear(); ((AppUninstallActivity) getActivity()).mSystemappInfo.addAll(list); mAdapter.update(((AppUninstallActivity) getActivity()).mSystemappInfo); } };