安卓清理后台程序
2015-09-01 15:00
435 查看
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("一键清理"); }
相关文章推荐
- ZOJ1234 Chopsticks
- ios与js 交互
- 使用php解析实现二级域名重定向
- 24 Swap Nodes in Pairs
- Eclipse导入所依赖的Android项目
- Fix “gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory” in Fedora
- Cocos-2d 坐标系及其坐标转换
- mysql分表的3种方法
- OpenCV的配置和获取摄像头画面
- 数据库设计(10)-范式化
- 链表环问题研究
- 2015 省赛 大还是小?
- CSS布局奇淫技巧之--各种居中
- 2015多校联合第一场5289Assignment RMQ+二分
- 8天玩转并行开发——第二天 Task的使用
- 【Leetcode】【Medium】Set Matrix Zeroes
- HIVE学习笔记 二 精简版
- Cmake使用教程
- PHPExcel类的导出
- Spring的注解形式:@Repository