Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to disable ListView?

I have a list view and want each cell in my within it to be disabled so that when you tap on it the text colors stay the same.

But I want it to be scrollable.

How can I achieve this?

like image 477
aryaxt Avatar asked Dec 28 '22 18:12

aryaxt


2 Answers

This similar post might be of help. The general approach is to disable all the items instead of the whole view. Essentially:

  • Inherit from ArrayAdapter (or any other adapter)
  • Override isEnabled(int position) to return false
  • Override areAllItemsEnabled() to return false
like image 60
kabuko Avatar answered Jan 12 '23 19:01

kabuko


all the easier! list.setEnabled(false)

like image 37
Master Avatar answered Jan 12 '23 19:01

Master