更新列表视图动态与适配器 [英] update listview dynamically with adapter

查看:104
本文介绍了更新列表视图动态与适配器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

教程使用一个SimpleAdapter工作正常,但我需要更新在适配器阵列时新的数据被输入。

This tutorial uses a SimpleAdapter which works fine, but I need to update the arrays in the adapter when new data is entered.

能否请你指导我如何使用别的东西比SimpleAdapter更新的ListView?

Could you please guide me on how to update a ListView using something else than a SimpleAdapter?

推荐答案

使用 ArrayAdapter 通过一个ArrayList支持。改变数据,只需更新列表中的数据,并调用<一href="http://developer.android.com/reference/android/widget/BaseAdapter.html#notifyDataSetChanged%28%29">adapter.notifyDataSetChanged().

Use a ArrayAdapter backed by an ArrayList. To change the data, just update the data in the list and call adapter.notifyDataSetChanged().

这篇关于更新列表视图动态与适配器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆