How to load data into reclyerview while downloading them from post async http request(如何在从 post async http 请求下载数据时将数据加载到 reclyerview)
问题描述
我正在开发一个 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 应用程序时,您的提要中有一些视频,然后当您向下滚动时,它开始加载,然后出现一些新视频,这称为分页.
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.
这是一种复杂的方法,但您可以通过阅读以下文章来实现.Paging 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.
这篇关于如何在从 post async http 请求下载数据时将数据加载到 reclyerview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在从 post async http 请求下载数据时将数据加载到 reclyerview
基础教程推荐
- 如何激活MC67中的红灯 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- MS Visual Studio .NET 的替代品 2022-01-01
- c# Math.Sqrt 实现 2022-01-01