Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ListView disable clicks and context menu on header view?

I set a header view using getListView().addHeaderView(view); and it currently gets treated in the same way as all of the other list rows with regards to clicks and context menus. How can I make the header view act like more of a header? Alternatively, how can I just add some content above the ListView that is not part of the ListView itself?

like image 327
Finbarr Avatar asked Mar 31 '11 23:03

Finbarr


1 Answers

Look at the second and third parameter of the addHeaderView method. You can simply disable interaction with

getListView().addHeaderView(view, null, false);
like image 86
whlk Avatar answered Oct 17 '22 12:10

whlk