从 Arraylist> 填充 ListView
我有一个 ArrayListfrom
字段中放置什么内容?示例如下:
String[] from = ?
int[] to = new int[] { R.id.contact, R.id.name});
adapter = new KindOfAdapter(this, R.layout.row, from, to)
希望很清楚。感谢任何帮助。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
1.实现 BaseAdapter
我认为最好的选择是扩展 BaseAdapter 并实现以下方法:
它看起来像这样:
2。谨慎使用 ViewHolder 模式
在实现 getView() 时,利用此设计模式将节省大量内存:
http://www.screaming-penguin.com/node/7767
1. Implement BaseAdapter
I think your best bet is to extend BaseAdapter and implement the following methods:
It would look something like this:
2. Be scrupulous about using the ViewHolder pattern
When implementing getView(), utilizing this design pattern will save a LOT of memory:
http://www.screaming-penguin.com/node/7767
ArrayAdapter> - ArrayAdapter 设计为与 ArrayLists(和 arrays[])一起使用,尽管它不支持 View 绑定,您只需重写 getView()
An ArrayAdapter> - ArrayAdapter is designed to be used with ArrayLists (and arrays[]), although it doesn't support View binding you only have to override getView()