Disabled item in the list of counters

I have a question for you!

I have 50 items in my counter, can I disable, for example, the sixth item in my list?

+6
source share
1 answer

You can get an element from an array in your ListAdapter based on its position and call setEnabled(false) in the public getView() method.

Like this:

 if (position==10) { convertView.setEnabled(false); } else{ convertView.setEnabled(true); } 

You may have to override some other methods. Check out these posts:

Android ListView child View setEnabled () and setClickable () do nothing
Android: how to disable list items when creating a list

+6
source

Source: https://habr.com/ru/post/892002/


All Articles