@Amir感谢您指出日志。 找到一行:
解码器-解码返回假
这似乎是常见的问题。 我搜索了一下找到了解决办法。
我的前代码:
urlconnectionconn=URL.open connection (;
conn.connect (;
inputstream=conn.get inputstream (;
缓冲输入流=newbufferedinputstream (输入流);
BMP=bitmap factory.decode stream (buffered inputstream );
代码工作:
http get http请求=null;
try {
HTP request=new http get (URL.touri );
}catch(urisyntaxexceptione ) {
e .打印堆栈跟踪(;
}
HTTP客户端HTTP客户端=newdefaulthttp客户端(;
httpresponse响应=(httpresponse ) httpclient.execute ) http请求;
htpentityentity=response.get entity (;
bufferedhttpentitybufhttpentity=newbufferedhttpentity (entity );
inputstream instream=bufhttpentity.get content (;
BMP=bitmap factory.decode stream (instream );