Example #1
0
  public static Check initCheckOf3G() {
    Check check =
        new Check(
            R.string.threeg_is_close,
            R.string.threeg_not_close,
            R.string.threeg_is_close_checking,
            new ICheckAction() {

              @Override
              public boolean check() {
                NetworkType networkType = NetworkUtil.isConnectedType();
                if (networkType == NetworkType.Mobile) {
                  return false;
                } else {
                  return true;
                }
              }
            });
    check.setCheckOperation(
        new CheckOperation() {
          @Override
          public void operate() {
            Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            BitherApplication.mContext.startActivity(intent);
          }
        });
    return check;
  }
Example #2
0
 public static Check initCheckOfBluetooth() {
   Check check =
       new Check(
           R.string.bluetooth_is_close,
           R.string.bluetooth_not_close,
           R.string.bluetooth_is_close_checking,
           new ICheckAction() {
             @Override
             public boolean check() {
               if (NetworkUtil.BluetoothIsConnected()) {
                 return false;
               } else {
                 return true;
               }
             }
           });
   check.setCheckOperation(
       new CheckOperation() {
         @Override
         public void operate() {
           Intent intent = new Intent(Settings.ACTION_BLUETOOTH_SETTINGS);
           intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
           BitherApplication.mContext.startActivity(intent);
         }
       });
   return check;
 }