protected void pickAction(@StringRes int id) {
   openActivityForResult(
       id,
       ActionPickerActivity.class,
       REQUEST_ACTION,
       new ExtraPutter() {
         @Override
         public void putExtras(Preference preference, Intent activityIntent) {
           mPrefKey = preference.getKey();
           ActionPickerActivity.putExtras(activityIntent, preference.getTitle(), true);
         }
       });
   Preference pref = findPreference(id);
   ActionInfo.Record record =
       ActionInfo.Record.fromPreference(
           pref.getSharedPreferences().getString(pref.getKey(), ""));
   updateActionSummary(pref, record);
 }
Exemple #2
0
 private ActionInfo.Record getActionRecord(SharedPreferences prefs, String key) {
   return ActionInfo.Record.fromPreference(prefs.getString(key, ""));
 }