Last active
September 27, 2021 11:58
-
-
Save burakaydn/6370941 to your computer and use it in GitHub Desktop.
This file contains 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
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to all prfile picture of a user in android