Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ListView Header Disable Click [duplicate]

I'm using isEnabled in my BaseAdapter of ListView and controlling which rows can be clickable. However, I want to disable click event for my header and isEnabled does not work. Position 0 points the first row, therefore I can not control header click.

On the other hand, when I add header using addHeaderView giving arguments (header, null, false) , it works but dividers are missing in that way. How can I manage this?

Is there anyone who knows this problem?

like image 929
BCK Avatar asked Dec 29 '11 16:12

BCK


1 Answers

You can use addHeaderView(header, null, false). For the header, inflate a view which has your header content with a divider underneath. This view is what I used for the divider.

<View     android:layout_width="fill_parent"     android:layout_height="1px"     android:background="#adaaad" /> 
like image 55
Cameron Ketcham Avatar answered Oct 12 '22 00:10

Cameron Ketcham