Android:从web下载图像并在gridview上显示 [英] Android: Download images from web and show them on gridview

查看:149
本文介绍了Android:从web下载图像并在gridview上显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个程序,从网页获取一些图像,并在gridview中显示它们。我不知道他们有多少。它可能是从20到30.不好用asynctask,我以前已经使用过,或多或少知道它是如何工作的。但是我不知道这一次使用它。

I want to create a program that gets some images from a webpage, and shows them on a gridview. I dont know how many of them exactly. It could be from 20 to 30. Ill do it with asynctask, which i have allready used before and more or less know how it works. But i don't know which way use it this time.

现在,我想要得到的是一个进度条(圆点击),而图像正在下载。一旦下载,它将消失,图像将加载。我将使用一个带有适配器的对象数组来填充gridview。

For now, what i would like to get is a progressbar (circle clicking) while image is downloading. And once its downloaded, it would disappear and image will load. I will use an array of objects with an adapter, to fill the gridview.

你会使用asynctask吗?

Which way would you use the asynctask?

提前感谢

推荐答案

我建议您查看讲座6 。有一个 URLImageAdapter 和示例源代码,您可以找到所需的内容。

I would suggest you check out Lecture 6 of Harvard Extension CS76. There is a URLImageAdapter and example source code that does example what you are looking for.

最好的运气

这篇关于Android:从web下载图像并在gridview上显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆