I would like to get a View instance that is used to display a specific Preference in my PreferenceActivity, so I can change its properties, for example:
public class SettingsActivity extends PreferenceActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preference); Preference pref = findPreference("key"); pref.getView().setVisibility(View.GONE);
I found this method only: getView (view convertView, parent group of ViewGroup) . But it seems confused to me that if I want to get an idea of my preferences, I need to provide view and viewGroup as parameters
Can someone explain how to use this method, or tell me another method to get a view from my Preference instance.
PS: if possible, I would prefer NOT to extend the preference class, but I don't mind if necessary
android view preferenceactivity
hendrix
source share