在Android的联网操作中,出现Channel is unrecoverably broken and will be disposed! ,当时的内心是崩溃的,浏览器连接没问题啊!,然后检查了一遍又一遍的代码,后来知道了,一般出现这种错误是流的操作出现了问题,当时我的代码是
String path="http://192.168.56.1:8080/androidgetimage/106.jpg";
File file=new File(Environment.getExternalStorageDirectory(),getIvName(path));
if (file.exists()){
Uri uri=Uri.fromFile(file);
Message message=Message.obtain();
message.what=SUCCESS;
message.obj=uri;
mhandler.sendMessage(message);
Log.i("TAG","从SD卡获取图片");
后来发现是路径拼写错误!,所以说!这种东西尽量Ctrl C,Ctrl V,自己强行装逼,苦了自己!!,如果你也有类似错误不防从流的操作去查找下错误!
我的博客网站:http://huyuxin.top/欢迎大家访问!评论!