我想通过
获取我的脸谱资料图片URL fb_pic = new URL("http://graph.facebook.com/"+(facebookuserID)+"/picture?style=small" );
我已成功获取图片网址。但是当我尝试将网址转换为位图时,我没有得到回复,
Bitmap bit = BitmapFactory.decodeStream(fb_pic.openConnection().getInputStream());
请给我一个解决方案...... !!!
答案 0 :(得分:2)
此代码对我有用
HttpGet httpRequest = new HttpGet(URI.create(linkUrl) );
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);
HttpEntity entrty = response.getEntity();
BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);
bmap = BitmapFactory.decodeStream(bufHttpEntity.getContent());
httpRequest.abort();