I have an activity which extends PreferenceActivity. I'm loading preferences from the xml file. But in some cases i need completely hide one of the preferences from the screen based on my app state. There is a setEnabled method, but it's not exactly what if want. I want to remove that preference from the screen completely. Is it possible ?
+5
A:
Yes, if you have a reference to both the Preference
, and its parent (a PreferenceCategory
, or PreferenceScreen
)
myPreferenceScreen.remove(myPreference);
David Hedlund
2010-02-10 21:07:56
thank you - totally works.
Alex Volovoy
2010-02-10 22:36:56