I built a preferences xml that I use as resource in two different activity pages.
The only problem is that I don’t want the LOGOUT button to show in one of those two pages (because the user is not connected yet).
What I did now is:
logoutButton = (Preference)getPreferenceScreen().findPreference("logout");
logoutButton.setEnabled(false);
the button now shows up in gray.. but is there a way to not make it show at all??
Thanks!
If your logout button (Preference) is in the PreferenceScreen, do this:
Else if your logout button (Preference) is in a PreferenceCategory (which is inside a PreferenceScreen), do this: