views:

268

answers:

1

As you can see from the screenshot below I have a ListView with multiple items in it. No matter what I try I can't seem to make the list item's not be selectable. I've tried all of the follow (in the XML layout for the ListView), but the items are STILL selectable with both a finger and the scroll wheel.

android:clickable="false" 
android:longClickable="false" 
android:focusable="false" 
android:focusableInTouchMode="false"

Any suggestions?

activity

+2  A: 

Each row of aListView are selectable, you might be interested in TableLayout, where items are not selectable, to achieve what you are looking for.

EDIT:

After searching a bit more, I found this archive post which suggests you try:

public boolean areAllItemsEnabled() {
   return false;
}

public boolean isEnabled(int position) {
  return false;
}

Hopefully that works for you.

Anthony Forloney
That did it... thanks. This should really be settable in the XML.
fiXedd
Yeah, I agree with you on that, maybe in the future they will produce better documentations online and have more attributes set via the XML.
Anthony Forloney