If you don't want them sticky,
and exactly know what positions the headers are going to be( in your data array),
then you could simply use following trick :
header is just another list item type,
so extend BaseAdapter and override following methods :
@Override
getViewTypeCount(){
return 2;// 1(list items) + 1(for header)
}
@Override
getItemViewType(int position){
if(want to show header at position)
return 1; // header item
else
return 0;// regular items
}
@Override
getView(int pos,....)
{
if(getItemViewType(pos)==0){// regular item
inflate/reuse convertView; // cast to regular item & bind data
} else {
inflate/reuse convertView; // cast to hdr view and bind data
}
return convertView;
}
for detailed analysis you could follow this link :
http://cyrilmottier.com/2011/07/05/listview-tips-tricks-2-section-your-listview/