android listviews: header and footer views
Yes, this is a bug or oversight in the ListView
component. You can work around this by writing your own WrapperListAdapter
that handles adding and removing fixed list items, but I can tell you it's not entirely straightforward to do.
Alternatively — and much easier — you could add a fixed component above or below the ListView
where you place the next and previous buttons.
How about reset the adapter at every time you need to add header view, like this way:
ListView.FixedViewInfo headerInfo = getListView().new FixedViewInfo();headerInfo.isSelectable=false ;headerInfo.view = feedInfoView;headerInfos.add(headerInfo);headerViewListAdapter = new HeaderViewListAdapter(headerInfos,null,adapter);getListView().setAdapter(headerViewListAdapter);