当我试图从facebook url获取位图图像时,显示位图为空。这是我的代码。
URL url = new URL("http://graph.facebook.com/100006480449004/picture?type=large");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.connect();
InputStream input = connection.getInputStream();
Bitmap myBitmap = BitmapFactory.decodeStream(input);
答案 0 :(得分:0)
在浏览器中输入网址,这会将您转到图片的正确网址,以.jpg
或者您可以通过connection.setInstanceFollowRedirects(true);