notifyDataSetChanged
来更新的,因为SimpleAdapter 主要是用来创建静态的数据的列表,如果要实现动态更新数据,需要自己定义一个基于BaseAdapter的adapter,然后通过notifyDataSetChanged
来更新list。
If you look at the SimpleAdapter description it says it is "An easy adapter to map static data to views defined in an XML file." I've added the emphasis -- put simply,
SimpleAdapater
isn't built for use with data that changes; it handles static data only. If you can't use an ArrayAdapter because your data has more than a single bit of text, then you will either have to build your own custom ListAdapter, or put your data in a DB and use one of the CursorAdapters.