Skip to content

Instantly share code, notes, and snippets.

@jhonvidal
Last active August 26, 2015 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhonvidal/a4ecdb78c690b2cc254a to your computer and use it in GitHub Desktop.
Save jhonvidal/a4ecdb78c690b2cc254a to your computer and use it in GitHub Desktop.
Method for extracting image faceook
/**
* Function loads the users facebook profile pic
*
* @param userID
*/
public static Bitmap getUserPic(String userID) {
String imageURL;
Bitmap bitmap = null;
Log.d(TAG, "Loading Picture");
imageURL = "https://graph.facebook.com/" + userID + "/picture?type=large";
try {
bitmap = BitmapFactory.decodeStream((InputStream) new URL(imageURL).getContent());
Log.d("TAG XXX", imageURL);
} catch (Exception e) {
Log.d("TAG", "Loading Picture FAILED");
e.printStackTrace();
}
return bitmap;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment