CursorAdapter vs ArrayAdapter for a ListView

旧巷老猫 提交于 2019-12-10 03:59:51

问题


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 an Array(List) adapter to link my online database with my ListView?
  • More generally, what are the arguments to consider when choosing between cursor and array?

回答1:


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 custom Cursor which ContentProvider returns on a query request.

Ref:

http://developer.android.com/guide/topics/providers/content-providers.html



来源:https://stackoverflow.com/questions/8556929/cursoradapter-vs-arrayadapter-for-a-listview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!