Closed archorfight closed 4 years ago
更新代码
这里的网络地址指的是:地址中带有http可以直接在浏览器访问的图片 一般情况下会走3的逻辑,也就是存储在本地,看你代码似乎不是最新的,如果拿不到最新代码, 只能给你网络下载的方法:你自己处理一下把try { if (imagePath.indexOf(",") != -1) { if(imagePath.startsWith(",")){ imagePath = imagePath.substring(1); } String[] images = imagePath.split(","); imagePath = images[0]; } URL url = new URL(imagePath); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); conn.setConnectTimeout(5 * 1000); InputStream inStream = conn.getInputStream(); value = readInputStream(inStream); } catch (Exception exception) { exception.printStackTrace(); }
该怎么搞?