How to update ListView on scrolling while retrieving data from server in Android?

后端 未结 3 666
广开言路
广开言路 2021-01-31 12:46

Currently, I\'m using AsyncTask to handle Http connection and retrieve data as JSON format.
Loading all data is trivial but it consumes too much time, so I decided to swi

3条回答
  •  臣服心动
    2021-01-31 13:26

    A typical approach would be e.g. to load 25 initially and then have a footer in the list that displays e.g. the current count and the total count and upon pressing loads another 25 and so on. That would be a paged sort of loading.

    When you do that you have to keep the current position and notify the adapter that the list has changed.

提交回复
热议问题