0

Is it possible to have a viewlist without the rows being clickable? I have information I want read in from a json file (I can do that) and then display that information in a list (I don't know how to do that atm (I do need help with that as well, but I'll try a bit more myself first)), but if I press on a row I don't want that to be highlighted for a few seconds. I tried changing ListView to TextView, but then the setAdapter gives an error. Is it possible to do that?

Mary
  • 7
  • 4
  • It's definitely possible to change the behavior of ListView so that you don't notice or react to clicks. There is some info on keeping the ListView and making it non-selectable here: http://stackoverflow.com/questions/2907335/android-disabling-highlight-on-listview-click – Charlie Collins Jan 14 '13 at 17:06
  • you can use `android:listSelector=@android:color/transparent` – njzk2 Jan 14 '13 at 17:06

1 Answers1

0

I think what you want to do is use setItemsCanFocus on your list view. This allows you to set whether the list itmes are focusable (i.e. can be highlighted). You can find more about it here in the android docs for ListView.

Rarw
  • 7,645
  • 3
  • 28
  • 46