谢谢@Amir指出日志。发现了一条线:
deprer->depre returned false
这似乎是一个普遍的问题。进行搜索后,我找到了解决方案。
我以前的代码:
URLConnection conn = url.openConnection();conn.connect();inputStream = conn.getInputStream();bufferedInputStream = new BufferedInputStream(inputStream);bmp = BitmapFactory.depreStream(bufferedInputStream);
起作用的代码:
HttpGet httpRequest = null;try { httpRequest = new HttpGet(url.toURI());} catch (URISyntaxException e) { e.printStackTrace();}HttpClient httpclient = new DefaultHttpClient();HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);HttpEntity entity = response.getEntity();BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);InputStream instream = bufHttpEntity.getContent();bmp = BitmapFactory.depreStream(instream);
资源
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)