Skip to content

Instantly share code, notes, and snippets.

@ziginsider
Last active November 20, 2017 13:27
Show Gist options
  • Save ziginsider/0b60055652a7275f5ba879e58c0b1047 to your computer and use it in GitHub Desktop.
Save ziginsider/0b60055652a7275f5ba879e58c0b1047 to your computer and use it in GitHub Desktop.
private void getData(JSONObject object) {
try {
URL profile_picture
= new URL("https://graph.facebook.com/"
+ object.getString("id")
+ "/picture?width=250&height=250");
Picasso.with(this).load(profile_picture.toString()).into(imgAvatar);
txtEmail.setText(object.getString("email"));
txtLocation.setText(object.getJSONObject("location").getString("name"));
txtBirthday.setText(object.getString("birthday"));
txtFriends.setText("Friends: " + object.getJSONObject("friends")
.getJSONObject("summary")
.getString("total_count"));
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment