我越来越MalformedURLException:协议未找到,当我试图从URL加载图像刺。当我粘贴该URL时,该图像在浏览器中显示。但不能在ImageView中显示。我用这个代码:获取MalformedURLException:找不到协议?
public static Bitmap getBitmapFromURL(String src) {
try
{
URL url = new URL(src);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.connect();
InputStream input = connection.getInputStream();
Bitmap myBitmap = BitmapFactory.decodeStream(input);
return myBitmap;
}
catch (IOException e) {
e.printStackTrace();
return null;
}
}
请有人告诉我最新的问题?这对我很有帮助。
你能告诉我们你的图片网址吗? – MByD 2012-04-11 04:59:18
难道你不想错过':'? – MByD 2012-04-11 05:03:01
感谢大家的支持 – 2012-04-11 05:12:06