开发者

How to update Listview's headerView when Cursor is updated?

I have a ListView with headerView, data is held by custom CursorAdapter:

View headerView = mInflater.inflate(R.layout.list_header_item, null);
mListView.addHeaderView(headerView);

mAdapter = new NewsCursorAd开发者_高级运维apter(this, getItemsCursor());
mListView.setAdapter(mAdapter);
//here do some header initialization from cursor

Could you please advice how to update header when cursor is changed? The problem is that data is populated from WebService, and not always exists onCreate()

ListView items are updated perfectly.


You have to do this yourself. Whatever code is updating the Cursor will need to arrange to update your headerView as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜