示例#1
0
  @Override
  public void onResume() {
    super.onResume();

    // Manually initialize the preference views that require massaging. Prefs that require
    // massaging include:
    //  1. a prefs UI control that does not map 1:1 to storage
    //  2. a pref that must obtain its initial value from migrated storage, and for which we
    //     don't want to always persist a migrated value
    final int autoAdvanceModeIndex =
        prefValueToWidgetIndex(
            AUTO_ADVANCE_VALUES, mMailPrefs.getAutoAdvanceMode(), AutoAdvance.DEFAULT);
    mAutoAdvance.setValueIndex(autoAdvanceModeIndex);

    final String removalAction = mMailPrefs.getRemovalAction(supportsArchive());
    updateListSwipeTitle(removalAction);

    listenForPreferenceChange(
        PreferenceKeys.REMOVAL_ACTION,
        PreferenceKeys.CONVERSATION_LIST_SWIPE,
        PreferenceKeys.SHOW_SENDER_IMAGES,
        PreferenceKeys.DEFAULT_REPLY_ALL,
        PreferenceKeys.CONVERSATION_OVERVIEW_MODE,
        AUTO_ADVANCE_WIDGET,
        PreferenceKeys.CONFIRM_DELETE,
        PreferenceKeys.CONFIRM_ARCHIVE,
        PreferenceKeys.CONFIRM_SEND);
  }