Until recently, using android.support.v4.app.FragmentPagerAdapter would prevent the usage of a PreferenceFragment as one of the Fragments used in the FragmentPagerAdapter.

The latest versions of the support v7 library now include the [PreferenceFragmentCompat](<http://developer.android.com/intl/es/reference/android/support/v7/preference/PreferenceFragmentCompat.html>) class, which will work with a ViewPager and the v4 version of FragmentPagerAdapter.

Example Fragment that extends PreferenceFragmentCompat:

import android.os.Bundle; 
import android.support.v7.preference.PreferenceFragmentCompat; 
import android.view.View; 
public class MySettingsPrefFragment extends PreferenceFragmentCompat { 
    public MySettingsPrefFragment() { 
        // Required empty public constructor 
    public void onCreate(Bundle savedInstanceState) { 
    public void onCreatePreferences(Bundle bundle, String s) { 

You can now use this Fragment in a android.support.v4.app.FragmentPagerAdapter subclass:

private class PagerAdapterWithSettings extends FragmentPagerAdapter {

    public PagerAdapterWithSettings(FragmentManager supportFragmentManager) {

    public Fragment getItem(int position) {
        switch(position) {
            case 0:
                return new FragmentOne();

            case 1:
                return new FragmentTwo();

            case 2:
                return new MySettingsPrefFragment();

                return null;
    // .......