Last active
August 26, 2015 14:52
-
-
Save jhonvidal/a4ecdb78c690b2cc254a to your computer and use it in GitHub Desktop.
Method for extracting image faceook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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