title: How do I link preferences.xml to my settingsTabFragment in my tablayout?
body: <p>I need to add settings to my final tab and have the data be editable, however I am having trouble doing so and do not know which methods to use.</p>
  
  <p>The tutorial I was following: <a href="https://github.com/codepath/android_guides/wiki/Settings-with-PreferenceFragment" rel="nofollow noreferrer">https://github.com/codepath/android_guides/wiki/Settings-with-PreferenceFragment</a></p>
  
  <p>SettingsTabFragment.java</p>
  
  <pre><code>package com.example.sachin.pedometer;
  
  import android.content.Context;
  import android.net.Uri;
  import android.os.Bundle;
  import android.preference.ListPreference;
  import android.preference.Preference;
  import android.support.annotation.Nullable;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  import com.takisoft.fix.support.v7.preference.PreferenceFragmentCompat;
  
  
  /**
   * A simple {@link Fragment} subclass.
   * Activities that contain this fragment must implement the
   * {@link SettingsTabFragment.OnFragmentInteractionListener} interface
   * to handle interaction events.
   * Use the {@link SettingsTabFragment#newInstance} factory method to
   * create an instance of this fragment.
   */
  public class SettingsTabFragment extends PreferenceFragmentCompat {
  
      private ListPreference mListPreference;
  
      @Override
      public void onCreatePreferencesFix(@Nullable Bundle savedInstanceState, String rootKey) {
  
          // Indicate here the XML resource you created above that holds the preferences
          setPreferencesFromResource(R.xml.preferences, rootKey);
      }
  
      /*@Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
          mListPreference = (ListPreference)  getPreferenceManager().findPreference("preference_key");
      mListPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
              @Override
              public boolean onPreferenceChange(Preference preference, Object newValue) {
                  // your code here
                  return view;
              }
          }
  
          return inflater.inflate(R.layout.fragment_settings_tab, container, false);
      }
  }
  </code></pre>