/**
   * Inflates the given XML resource and adds the preference hierarchy to the current preference
   * hierarchy.
   *
   * @param preferencesResId The XML resource ID to inflate.
   */
  public void addPreferencesFromResource(@XmlRes int preferencesResId) {
    requirePreferenceManager();

    setPreferenceScreen(
        mPreferenceManager.inflateFromResource(
            getActivity(), preferencesResId, getPreferenceScreen()));
  }
  /**
   * Adds preferences from activities that match the given {@link Intent}.
   *
   * @param intent The {@link Intent} to query activities.
   */
  public void addPreferencesFromIntent(Intent intent) {
    requirePreferenceManager();

    setPreferenceScreen(mPreferenceManager.inflateFromIntent(intent, getPreferenceScreen()));
  }