code: private void addNavigationPreference() {
          NavigationPreference navigationPreference = new NavigationPreference(this);
          navigationPreference.setTitle(getPreferenceHeaderTitle());
          navigationPreference.setFragment(NewPreferenceHeaderFragment.class.getName());
          getNavigationFragment().getPreferenceScreen().addPreference(navigationPreference);
          invalidateOptionsMenu();
      }
docs: Dynamically adds a new navigation preference to the activity.