@Override
  protected void onPostExecute(Integer result) {
    try {
      connectDialog.dismiss();
    } catch (Exception e) {
    }

    if (result == CONNECTION_ERROR) {
      Toast toast =
          Toast.makeText(context, "Failed to save changes, connection failed", Toast.LENGTH_LONG);
      toast.show();
    } else if (result == FAIL) {
      Toast toast =
          Toast.makeText(context, "Camera rejected settings, please try again", Toast.LENGTH_LONG);
      toast.show();
    } else if (result == SUCCESS) {
      Toast toast = Toast.makeText(context, "Settings updated successfully", Toast.LENGTH_SHORT);
      toast.show();
      context.saveComplete();
    }
  }
 @Override
 protected void onPreExecute() {
   connectDialog = new ConnectDialog();
   connectDialog.setCancelable(false);
   connectDialog.show(context.getFragmentManager(), "connect");
 }