ListView 的 CursorAdapter 与 ArrayAdapter
我想用来自网络的 JSON 形式的数据填充我的 ListView
。该列表理论上应该是无限的,如果滚动到底部,应用程序会请求更多数据。
- 我应该使用
Cursor
还是Array(List)
适配器将我的在线数据库与ListView
链接起来? - 更一般地说,在光标和数组之间进行选择时要考虑哪些参数?
I want to fill my ListView
with data that's going to come from the web in the form of JSON. The list should be theoretically infinite, with the app making requests for more data if scrolled to the bottom.
- Should I use a
Cursor
or anArray(List)
adapter to link my online database with myListView
? - More generally, what are the arguments to consider when choosing between cursor and array?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,我认为你应该看看
ContentProviders
。它们对于您试图解决的问题更加自然。您必须实现ContentProvider
在查询请求时返回的自定义Cursor
。参考:
http://developer.android.com/guide/topics/providers/content-providers。 html
Well I think you should look at
ContentProviders
. They are more natural to the problem that you are trying to solve. You have to implement your customCursor
whichContentProvider
returns on a query request.Ref:
http://developer.android.com/guide/topics/providers/content-providers.html