问题
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?
回答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