Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't resolve symbol PreferenceFragmentCompat

I'm trying to set up my SettingsFragment using PreferenceFragmentCompat but android studio give an error that Can't resolve symbol PreferenceFragmentCompat ... I'm using android studio 3.6.2

like image 802
Assem Abed Avatar asked Dec 31 '22 02:12

Assem Abed


1 Answers

In your app's build.gradle make sure you have the corect dependency:

implementation 'androidx.preference:preference:1.1.0'

Then in your SettingsFragment import the library

Kotlin:

class SettingsFragment : PreferenceFragmentCompat() { }

Java:

public class SettingsFragment extends PreferenceFragmentCompat { }
like image 66
Muzzle Avatar answered Jan 04 '23 17:01

Muzzle