问题描述
我正在开发一个android
应用程序,需要使用httpclient
从我的server
下载数据(产品详细信息,图像),问题是我需要等到所有数据下载完毕.我需要显示已为downloaded
的数据,而其他数据则为继续downloading
的数据.
I am developing an android
app which need's to download data(products details,images) from my server
using httpclient
the problem is i need to wait until all data has finished download. i need to show data which has been downloaded
while other are continue downloading
.
推荐答案
也许您想进行分页.社交媒体订阅源中发生的事情是一样的,向下滚动时内容将下载.例如,当您输入youtube应用程序时,Feed中会有一些视频,然后当您向下滚动时,它开始加载,然后出现一些新视频,这称为分页.
Maybe you want to do pagination. It is the same thing that happens in social media feed, the content will download as you scroll down. For example, when you enter in the youtube app there is some video in your feed and then when you scroll down, it starts loading and then some new videos appear, this is called Pagination.
这是一种复杂的方法,但是您可以通过阅读以下文章来做到这一点. Android分页指南,有关分页的视频.
This is a complex approach but you can do it by reading the following articles. Paging Android Guide, Video about Paging.
After reading these articles you can follow this tutorial, and here is the source code of this tutorial.
这篇关于从异步HTTP请求下载数据时如何将数据加载到reclyerview中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!