code: public static boolean changeMobileDataState(boolean dataEnabled)
      {
          if(Build.VERSION.SDK_INT < 9) {
              throw new UnsupportedOperationException("Unsupported SDK version. This operation is only available on SDK 9 or above.");
          }
  
          try {
              ConnectivityManager connectivityManager = (ConnectivityManager) QuickUtils.getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
              Class connectivityManagerClass = Class.forName(connectivityManager.getClass().getName());
              Method setMobileDataEnabled = connectivityManagerClass.getDeclaredMethod("setMobileDataEnabled", Boolean.TYPE);
              setMobileDataEnabled.setAccessible(true);
              setMobileDataEnabled.invoke(connectivityManager, dataEnabled);
  
              return true;
          } catch(Exception e) {
              return false;
          }
      }
docs: Set mobile data connectivity on/off.
  API level 9+ only (Android 2.3+).
  This method will need "android.permission.CHANGE_NETWORK_STATE" permission.
  
  @param dataEnabled true to enable and false to disable mobile data
  @return true if set successfully, false otherwise