1
我需要從twitter登錄獲取信息。我可以登錄,但試圖獲取用戶信息時,(Twitter.getApiClient(session))在庫中找不到。請告訴我我做錯了什麼。Twitter.getApiClient(session)找不到android
所使用的庫和代碼是:
compile 'com.twitter.sdk.android:twitter:3.0.0'
compile 'com.twitter.sdk.android:twitter-mopub:3.0.0'
public static void getResultTwitter(TwitterSession session){
Call<User> userResult =Twitter.getApiClient(session).getAccountService().verifyCredentials(true,false);
userResult.enqueue(new Callback<User>() {
@Override
public void failure(TwitterException e) {
}
@Override
public void success(Result<User> userResult) {
User user = userResult.data;
String twitterImage = user.profileImageUrl;
try {
Log.d("imageurl", user.profileImageUrl);
Log.d("name", user.name);
Log.d("email",user.email);
Log.d("des", user.description);
Log.d("followers ", String.valueOf(user.followersCount));
Log.d("createdAt", user.createdAt);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
我面臨同樣的問題.. unresolve方法getApiClient –