Alternatives to PreferenceFragment with android-support-v4

Solution 1:

I know this is an old question, but you can now use PreferenceFragmentCompat from com.android.support:preference-v7:23.3.0

Solution 2:

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;