John
John

Reputation: 323

How to make some item unselectable in ListPreference

At the PreferenceActivity has a listPreference. And I already setup the entries (e.g. "A" to "E") and entriesValues by programming method(not in xml).

is it possible to make some entry items unselectable which refer to the system version.

Upvotes: 2

Views: 1409

Answers (2)

Royston Pinto
Royston Pinto

Reputation: 6716

For regular list items you may just return false for the 'boolean isEnabled (int position)'. This will make the item non clickable.

Upvotes: 1

guerilla
guerilla

Reputation: 405

Use setSelectable(false) on the Preference object. See also http://developer.android.com/reference/android/preference/Preference.html

Upvotes: 0

Related Questions