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.
精彩评论