android - how can hide a preference from the screen -


I have a class setting PreferenceActivity tool enhances OnSharedPreferenceChangeListener . I am loading preferences from the XML file but in some cases I need to hide the preferences screen completely based on my app status. I want to remove that preference completely from the screen. Is this possible? I only need to hide settings_account and everything else

   & Lt; PreferenceScreen Android: title = "@ string / account_1" Android: key = "account" & gt; & Lt; EditTextPreference Android: key = "username" android: title = "@ string / settings_username" android: singleLine = "true" /> Android: password = "true" android: singleLine = "true" /> & Lt; / PreferenceScreen & gt; & Lt; PreferenceScreen Android: Title = "@ String / Account 2" Android: key = "account1" & gt; & Lt; EditTextPreference Android: key = "username1" android: title = "@ string / settings_username" android: singleLine = "true" /> Android: edit = & lt; / PreferenceScreen & gt;   

  android: title = "@ string / settings_pbxes_options" & gt; & Lt; Checkbox projection Android: key = "par" android: title = "@ string / settings_par" Android: summary = "@ string / settings_ 2" /> & Lt; Checkbox projection Android: key = "correction" Android: title = "@ string / settings_ improve" /> & Lt; EditTextPreference Android: key = "posurl" android: title = "@ string / settings_posurl" Android: sign = "https://www1.pbxes.com/name" Android: singleLine = "true" /> & Lt; CheckboxSpeed ​​Android: key = "pos" android: title = "@ string / settings_pos" Android: Summary = "@ string / settings_ pos2" /> & Lt; Checkbox Launch Android: Key = "Callback" Android: Title = "@ string / settings_ callback" Android: Summary = "@ string / settings_ callback2" /> & Lt; Checkbox Launch Android: Key = "Callthrough" Android: Title = "@ string / settings_ callthru" Android: Summary = "@ string / settings_ callback2" /> & Lt; EditTextPreference Android: Key = "Callthrough 2" Android: Title = "@ string / settings_ callthru2" Android: signal = "Exesno., Pin #Android: SingleLine =" True "/> & lt; / PreferenceScreen & gt;  Perhaps you can create a second priority xml and load instead of   



Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -