Example #1
0
 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent data) {
   if (requestCode == PICK_DROPBOX_DIR_CODE) {
     if (resultCode == Activity.RESULT_OK) {
       PreferenceManager.getDefaultSharedPreferences(getActivity())
           .edit()
           .putString(KEY_DROPBOX_DIR, data.getData().getPath())
           .commit();
     } // else was cancelled
   } else if (requestCode == PICK_SD_DIR_CODE) {
     if (resultCode == Activity.RESULT_OK) {
       // Set it
       File path = new File(data.getData().getPath());
       if (path.exists() && path.isDirectory() && path.canWrite()) {
         PreferenceManager.getDefaultSharedPreferences(getActivity())
             .edit()
             .putString(KEY_SD_DIR, path.toString())
             .commit();
       } else {
         Toast.makeText(getActivity(), R.string.cannot_write_to_directory, Toast.LENGTH_SHORT)
             .show();
       }
     } // else was cancelled
   } else {
     super.onActivityResult(requestCode, resultCode, data);
   }
 }
 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent data) {
   if (requestCode == ActivityRequestCodes.IMPORT_CONFIG && resultCode == Activity.RESULT_OK) {
     SyncthingUtils.importConfig(getActivity(), data.getData(), false);
     mSettings.setInitialized(ConfigXml.get(getActivity()) != null);
   } else {
     super.onActivityResult(requestCode, resultCode, data);
   }
 }
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (resultCode == Activity.RESULT_OK) {
      if (requestCode == DESCRIPTION_EDIT && data != null) {
        repoRequestDTO.description = data.getStringExtra(ContentEditorActivity.CONTENT);
      }
    }
  }
Example #4
0
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
    // Do not check resultCode here as it is always RESULT_CANCELED
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == REQUEST_INSTALL_DATA) {
      update();

      LanguageData lang = mLanguages.get(mSelectedLanguage);
      if (lang != null && lang.downloaded) setLanguage(lang);
    }
  }
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == Constants.SET_PIN_REQUEST_CODE) {
      if (resultCode == Activity.RESULT_OK) {
        pinPreference.setChecked(true);
      } else if (resultCode == Activity.RESULT_CANCELED) {
        pinPreference.setChecked(false);
      }
    }
  }
 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent data) {
   if (requestCode == RESULT_DEBUG_APP) {
     if (resultCode == Activity.RESULT_OK) {
       mDebugApp = data.getAction();
       writeDebuggerOptions();
       updateDebuggerOptions();
     }
   } else {
     super.onActivityResult(requestCode, resultCode, data);
   }
 }