开发者

ListView add more items

I have a ListView and set a SimpleAdapter to s开发者_开发问答how some formated items, then how could i add other items to the items Listview with the old format.


If you add more data to the List you supplied in the SimpleAdapter constructor and then call mySimpleAdapter.notifyDataSetChanged() method afterwards the ListView will refresh itself.


You'll need to extend the BaseAdapter class and create a method addItem() that adds your item to the BaseAdapater's item model. Then you should call notifyDatasetChanged to have your listview updated.

There are tons of examples of this online and on SO.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜