private void clearMore() {
int total = 0;
int memorySize = 0;
for (ProcessInfo infos : processInfoList) {
if (infos.isChecked()) {
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
am.killBackgroundProcesses(infos.getPkgname());
total++;
memorySize += infos.getMemSize();
processInfoList.remove(infos);
break;
}
}
Toast.makeText(
this,
"清理了" + total + "个进程," + "释放了"
+ TrafficDataUtil.getMemoryData(memorySize) + "内存",
Toast.LENGTH_SHORT).show();
adapter=new ClearMemoryAdapter(this, processInfoList);
listView.setAdapter(adapter);
btn_clea.setText("一键清理");
}
安卓清理后台程序
最新推荐文章于 2024-04-22 13:09:30 发布