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
- C# 中多线程网络服务器的模式 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 输入按键事件处理程序 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01