Skip to content Skip to sidebar Skip to footer

Android: How Do I Call Findpreference() From My Main Activity?

I'm handling the preferences screen for my Android app. I want to disable (grey it out) an item if the preceding one has a specific value. I have implemented two classes: MainActiv

Solution 1:

findPreference() should be called from a class implementing PreferenceActivity interface (PreferencesActivity in my context). MainActivity properties can be accessed via SharedPreferences class.


Post a Comment for "Android: How Do I Call Findpreference() From My Main Activity?"