Alternatives to PreferenceFragment with android-support-v4

后端 未结 9 2061
误落风尘
误落风尘 2020-11-28 04:50

I\'ve come to a sudden halt in the development of my app as I realized that PreferenceFragments weren\'t supported in this library. Are there any alternatives that a rookie

9条回答
  •  遥遥无期
    2020-11-28 05:14

    UPDATE - 6/11/2015

    Support-v7 library now includes PreferenceFragmentCompat. So it will be a better idea to use it.


    Add the following project as a library project to your application.

    https://github.com/kolavar/android-support-v4-preferencefragment

    You can keep everything including your fragment transaction as it is. When importing the PreferenceFragment class, make sure the correct import header is user.

    import android.support.v4.preference.PreferenceFragment;
    

    instead of

    import android.preference.PreferenceFragment;
    

提交回复
热议问题