Reputation: 2362
I'm trying to get my facebook profile picture by
URL fb_pic = new URL("http://graph.facebook.com/"+(facebookuserID)+"/picture?style=small" );
Ihave successfully got the image url.But when i try to convert the url into Bitmap i'm not getting response,
Bitmap bit = BitmapFactory.decodeStream(fb_pic.openConnection().getInputStream());
Please give me a solution...!!!
Upvotes: 2
Views: 687
Reputation: 21
This code is working for me
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();
Upvotes: 2