Android : Load image from web URL(Android:从网页 URL 加载图像)
问题描述
可能重复:
加载远程图片
我正在开发一个应用程序,其中有一个列表,其中每一行都有一个图像,
I am developing an application where I have a list in which each row has an image,
这张图片是从一个网址加载的.
this image is loaded from a web URL.
下面是我的代码
这是活动代码
当我跑步时,我在设备上什么也得不到.只有灰屏,没有异常发生.
when I run i get nothing on the device. only a gray screen and no exception happens.
请注意,我在清单文件中添加了此权限
note that i added this permission in the manifest file
谁能帮帮我?
推荐答案
使用以下代码从 url 下载图像并将图像显示到 imageview 中,这将解决您的问题.
Use below code for download image from url and display image into imageview, this will solve your problem.
这篇关于Android:从网页 URL 加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!