Android 手机卫士13--进程设置_移动开发_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > 移动开发 > Android 手机卫士13--进程设置

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

 2016/10/21 5:30:51  ganchuanpu  程序员俱乐部  我要评论(0)
  • 摘要:1.显示隐藏系统进程修改ProcessManagerActivity的Adapter.....@OverridepublicintgetCount(){if(SpUtil.getBoolean(getApplicationContext(),ConstantValue.SHOW_SYSTEM,false)){returnmCustomerList.size()+mSystemList.size()+2;}else{returnmCustomerList.size()+1;}}2
  • 标签:手机 android

1.显示隐藏系统进程

修改ProcessManagerActivity的Adapter

class="brush:java;gutter:true;">.....
@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);
		}
	}
}

  

发表评论
用户名: 匿名