How can i get Profile image of logged in user

android

#1

I used the code from Android get user profile image
,But it is getting crashed.


#2

Can you share more about the error you are seeing?


#3

The post you linked to was based on pervious versions of TwitterKit. One can retrieve the profile image from AccountService#verifyCredentials which returns a User object.

    Call<User> call = Twitter.getApiClient(session)
            .getAccountService()
            .verifyCredentials(true, false);
    call.enqueue(new Callback<User>() {
        @Override
        public void success(Result<User> result) {
            // Do something with user object
        }

        @Override
        public void failure(TwitterException exception) {

        }
    });