Exemplo n.º 1
0
 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent data) {
   switch (requestCode) {
     case REQUEST_BLACKLIST:
       if (resultCode == RESULT_OK) {
         Set<String> blacklist =
             (Set<String>) data.getSerializableExtra(AppSelectActivity.EXTRA_SELECTED_HASH_SET);
         getPreferenceManager()
             .getSharedPreferences()
             .edit()
             .putStringSet(mPrefKey, blacklist)
             .apply();
       }
       break;
     default:
       super.onActivityResult(requestCode, resultCode, data);
   }
 }
Exemplo n.º 2
0
 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent data) {
   switch (requestCode) {
     case REQUEST_ACTION:
       if (resultCode == RESULT_OK) {
         ActionInfo.Record record =
             (ActionInfo.Record)
                 data.getSerializableExtra(ActionPickerActivity.EXTRA_ACTION_RECORD);
         MyApp.logD("picked intent: " + record.intentUri);
         // save
         Preference pref = findPreference(mPrefKey);
         pref.getSharedPreferences()
             .edit()
             .putString(mPrefKey, record.toStringForPreference())
             .apply();
         updateActionSummary(pref, record);
       }
       break;
     default:
       super.onActivityResult(requestCode, resultCode, data);
   }
 }