解决方法
检查HTTP
Content-Type
响应头是否以image /开头.
URLConnection connection = new URL("http://foo.bar/w23afv").openConnection(); String contentType = connection.getHeaderField("Content-Type"); boolean image = contentType.startsWith("image/");