android联系人批量删除优化时间

android联系人批量删除时总要求效率要高,时间要快。可以对联系人分块删除。以下代码,看看有没有还需要优化的地方。

private static Object mLock = new Object();
	class DeleteContactsThread extends Thread{
		long[] mIds;
		String ids = "";
		int temp_con = 0;
		int divide_con = 0;
		public DeleteContactsThread(long[] ids){
			//Here we can also add wakelock
			mIds = ids;
		}
		public void run(){
			super.run();
			synchronized(mLock){
				int length = mIds.length;
				if(length >= 1500){
					divide_con = 200;
				}else if(length > 1000){
					divide_con = 100;
				}else if(length > 500){
					divide_con = 50;
				}else divide_con = 10;
				try{
					for(int i=0;i


你可能感兴趣的:(android学习,Java)