从网络获取图像并将其保存到手机内存? [英] Get image from web and save it to phones memory ?

查看:141
本文介绍了从网络获取图像并将其保存到手机内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从网上获取的图像,并将其存储在手机中供以后使用。

I need to get image from the web and store it in the phone for later use.

我trye​​d这一点:

I tryed this:

 public Drawable grabImageFromUrl(String url) throws Exception
    {
     return Drawable.createFromStream((InputStream)new URL(url).getContent(), "src");
    }

所以这个我函数从网址抓取图像,我只需要下面的一个进程得到返回的绘制和保存。

So this my function to grab image from Url, i just need a proccess to get the returned drawable and save.

我怎样才能做到这一点?

How can i do that ?

推荐答案

看到这个完整的例子在这里给出

see this complete example give here

http://android-example-$c$c.blogspot.in/p/download-store-and-read-images-from.html

这篇关于从网络获取图像并将其保存到手机内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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