java.lang.IllegalStateException: Must specify preferenceTheme in theme (Android PreferenceFragmentCompat)

April 17, 2018

Edit res/values/styles.xml to include preferenceTheme for AppTheme (theme used by Activity in AndroidManifest.xml)

NOTE: applicable to support library PreferenceFragmentCompat only, not standard PreferenceFragment.

<style name="AppTheme.NoActionBar">
    <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
    <!-- <item name="preferenceTheme">@style/PreferenceThemeOverlay</item> -->
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

Refer to Android Settings Preference Using PreferenceFragmentCompat for complete example.

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.