码迷,mamicode.com
首页 > 移动开发 > 详细

Android 手机卫士13--进程设置

时间:2016-10-21 00:22:36      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

1.显示隐藏系统进程

修改ProcessManagerActivity的Adapter

.....
@Override
public int getCount() {
	if(SpUtil.getBoolean(getApplicationContext(), ConstantValue.SHOW_SYSTEM, false)){
		return mCustomerList.size()+mSystemList.size()+2;
	}else{
		return mCustomerList.size()+1;
	}
}

  

2.锁屏清理

public class LockScreenService extends Service {
	private IntentFilter intentFilter;
	private InnerReceiver innerReceiver;
	@Override
	public void onCreate() {
		
		//锁屏action
		intentFilter = new IntentFilter(Intent.ACTION_SCREEN_OFF);
		innerReceiver = new InnerReceiver();
		registerReceiver(innerReceiver, intentFilter);
		
		super.onCreate();
	}
	@Override
	public IBinder onBind(Intent intent) {
		return null;
	}
	@Override
	public void onDestroy() {
		if(innerReceiver!=null){
			unregisterReceiver(innerReceiver);
		}
		super.onDestroy();
	}
	
	class InnerReceiver extends BroadcastReceiver{
		@Override
		public void onReceive(Context context, Intent intent) {
			//清理手机正在运行的进程
			ProcessInfoProvider.killAll(context);
		}
	}
}

  

Android 手机卫士13--进程设置

标签:

原文地址:http://www.cnblogs.com/ganchuanpu/p/5983067.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!