gellyke gellyke - 20 days ago 5
Android Question

How to get profile picture in android using Twitter kit,

I'm trying to implement a simple application that uses Twitter kit. The problem is that i'm not able to get the profile picture.Any help would be appreciated.

Thanks

Answer

Found the answer.

There is a callback which gives you back the User object.

  Twitter.getApiClient().getAccountService().verifyCredentials(true, false, new Callback<User>() {
                @Override
                public void success(Result<User> userResult) {
                }

                @Override
                public void failure(TwitterException e) {
                }
            });

On the success branch, you can get the User object by calling:

 User user = userResult.data;

And from this object you can get all the information form the user.For the op

String profileImage= user.profileImageUrl;