public void handleMessage(Message msg) {
   switch (msg.what) {
     case SETLEAVEDIALOG_DISS:
       {
         appSettingAdapter.notifyDataSetChanged();
         break;
       }
     case SplashActivity.CHECKVERSION_CANCEL:
     case SplashActivity.CHECKVERSION_EOOR:
       break;
     case SplashActivity.CHECKVERSION_DOWN:
       {
         // 通知栏更新,下载文件
         Intent updateIntent = new Intent(AppSettingActivity.this, UpdateService.class);
         updateIntent.putExtra("appUrl", downLoadFileUrl);
         startService(updateIntent);
         break;
       }
     case UPDATEADAPTER:
       {
         appSettingAdapter.notifyDataSetChanged();
         break;
       }
     default:
       break;
   }
 }
 private void hideLeaverTime() {
   for (AppSettingItemInfo appSettingItemInfo : dataAppSettingItemInfos) {
     if (appSettingItemInfo.getClassID() == 10) {
       dataAppSettingItemInfos.remove(appSettingItemInfo);
       appSettingAdapter.notifyDataSetChanged();
       break;
     }
   }
 }
 private void showLeaverTime() {
   AppSettingItemInfo appSettingItemInfo9 =
       new AppSettingItemInfo(
           10,
           7,
           false,
           false,
           false,
           "",
           getString(R.string.pwdsetting_advance_allowleavetime_title),
           getString(R.string.pwdsetting_advance_allowleavetime_detail_30second),
           "");
   dataAppSettingItemInfos.add(appSettingItemInfo9);
   appSettingAdapter.notifyDataSetChanged();
 }
 @Override
 protected void onResume() {
   // TODO Auto-generated method stub
   appSettingAdapter.notifyDataSetChanged();
   super.onResume();
 }
 @Override
 public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
   // TODO Auto-generated method stub
   SwitchButton switchButton = (SwitchButton) buttonView;
   LogUtil.e("colin", "switch is changed:" + switchButton.getId());
   switch (switchButton.getId()) {
     case 2: // 启用加锁
       {
         boolean bIsState = !switchButton.isChecked();
         appLockApplication.setAppLockState(bIsState);
         break;
       }
     case 8: // 新应用加锁提示
       {
         break;
       }
     case 9: // 允许短暂退出
       {
         boolean bIsState = !switchButton.isChecked();
         appLockApplication.setAllowedLeaveAment(bIsState);
         Intent intent = new Intent(LockService.LOCK_SERVICE_LEAVEAMENT);
         intent.putExtra(LockService.LOCK_SERVICE_LEAVEAMENT, bIsState);
         sendBroadcast(intent);
         LogUtil.d("demo3", "bIsState:" + bIsState);
         break;
       }
     case 11: // 锁锁图标的隐藏和显示
       {
         setHideAppIcon();
         break;
       }
     case 12: // 防卸载
       {
         if (!switchButton.isChecked()
             && !devicePolicyManager.isAdminActive(componentName)) {
           enableDeviceManager();
         } else if (switchButton.isChecked()
             && devicePolicyManager.isAdminActive(componentName)) {
           disableDeviceManager();
         }
         break;
       }
     case 18: // 自动拍照
       {
         appLockApplication.setAutoRecordPic(!switchButton.isChecked());
         if (appLockApplication.getAutoRecordPic()) {
           WarringDialog warringDialog = new WarringDialog();
           warringDialog.switchButton = switchButton;
           warringDialog.show();
         }
         break;
       }
     case 19: // 播放告警声音
       {
         appLockApplication.setPlayWarringSoundState(!switchButton.isChecked());
         break;
       }
     default:
       break;
   }
   appSettingAdapter.notifyDataSetChanged();
 }