@Override
protected Bitmap doInBackground(String... params) {
String url=params[0];
Bitmap bitmap=null;
URLConnection connection;
InputStream is;
//通过URL.openConnection方法获得一个URLConnection对象
try {
URL myurl = new URL(url);
connection=myurl.openConnection();
connection.connect();
is=connection.getInputStream();
//包装一下
//BufferedInputStream bis=new BufferedInputStream(is);
//将一个输入流解析为一个BitMap对象
bitmap=BitmapFactory.decodeStream(is);
//关闭输入流
is.close();
//bis.close();
} catch (MalformedURLException e) {
Log.i("info", "MalformedURLException");
e.printStackTrace();
} catch (IOException e) {
Log.i("info", "IOException:"+e.toString());
e.printStackTrace();
}
return bitmap;
}
Urlconnection对象获得inputStream值
-
include(C:\\work\\blog): failed to open stream: Permission denied
laravel搭建的程序无缘无故的变成了,include(C:\\work\\blog): failed to open stream: Permission denied
-
js获取上一页、当前页及域名url方法,JS反回上一页的方法
js获取上一页、当前页及域名url方法,JS反回上一页的方法
-
js如何判断是否在iframe中及防止网页被别站用iframe嵌套
本文主要介绍了js判断是否在iframe中及防止网页被别站用 iframe嵌套的方法。具有很好的参考价值,一起来看下吧
-
laravel Eloquent 如何实现 FIND_IN_SET ,并实现分页
有个文章表里面有个type字段,他存储的是文章类型,有 1头条,2推荐,3热点,4图文 .....11,12,13等等 现在有篇文章他既是 头条,又是热点,还是图文,
-
MySQL关于根据日期查询数据的sql语句
MySQL关于根据日期查询数据的sql语句
-
Failed to read artifact descriptor for org.apache.axis:axis:jar:1.4
pom这个报错,不一定是真的报错,看看下面的详解吧
-
cannot cast 'javax.xml.rpc.Call' to 'org.apache.axis.client.Call
用java调用axis报错的解决方案
-
jquery animate 连续点击不能平滑滚动的原因
通过设置延迟的方式解决平滑滚动
-
E45: 'readonly' option is set (add ! to override)
E45: 'readonly' option is set (add ! to override)
-
nginx 安装提示缺少pcre
经查看我的服务器里面有pcre,为什么还提示我缺少pcre。