Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save burakaydn/6370941 to your computer and use it in GitHub Desktop.
Save burakaydn/6370941 to your computer and use it in GitHub Desktop.
Bundle bundle = new Bundle();
bundle.putString("fields", "picture.type(large),quotes,email,first_name,last_name,username");
final Request request = new Request(ParseFacebookUtils.getSession(),
"me", bundle, HttpMethod.GET, new Request.Callback() {
@Override
public void onCompleted(Response response) {
GraphObject graphObject = response.getGraphObject();
if (graphObject != null) {
//Parse graphObject to User
JSONObject jsonUser = graphUser.getInnerJSONObject();
try {
mUser.setEmail(jsonUser.getString(EMAIL));
mUser.setImageUri(jsonUser.getJSONObject("picture").getJSONObject("data").getString("url"));
mUser.setName(jsonUser.getString("first_name"));
mUser.setSurname(jsonUser.getString("last_name"));
mUser.setUsername(jsonUser.getString("username"));
} catch (JSONException e) {
Log.e(TAG, e.toString());
e.printStackTrace();
}
}
}
});
Request.executeBatchAsync(request);
@DebdeepNandy
Copy link

how to all prfile picture of a user in android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment