You can use the Android 10 support library version of PreferenceManager
, i.e., androidx.preference.PreferenceManager
and not android.preference.PreferenceManager
.
Remember to add the following to your build.gradle:
implementation 'androidx.preference:preference:1.1.1'