我正在尝试让一个简单的 Android 应用程序为 Twitter 工作。我正在使用图书馆 jtwitter。我正在尝试使用 AndroidTwitterLogin 类。我有一个使用 OAuth 进行身份验证的按钮。它调用此代码。
public void authorizeApp(View v) {
AndroidTwitterLogin atl = new AndroidTwitterLogin(this,
MY_TWITTER_KEY,MY_TWITTER_SECRET,MY_TWITTER_CALLBACK) {
protected void onSuccess(Twitter jtwitter, String[] tokens) {
jtwitter.setStatus("I can now post to Twitter using my android app !");
Log.i("TwitterOAuth","successfully authorized app");
authorizeText.setText("Authorized");
// Recommended: store tokens in your app for future use
// with the constructor OAuthSignpostClient(String consumerKey, String consumerSecret, String accessToken, String accessTokenSecret)
}
};
atl.run();
}
在运行时,当我到达 AndroidTwitterLogin.run 行时,它会因以下代码而崩溃。
Caused by: java.lang.NoSuchMethodError: No static method i(Ljava/lang/String;Ljava/lang/String;)V in class Landroid/util/Log; or its super classes (declaration of 'android.util.Log' appears in /system/framework/framework.jar)
at winterwell.jtwitter.android.AndroidTwitterLogin.run(AndroidTwitterLogin.java:78)
at com.franksapps.twitteroauth.TwitterActivity.authorizeApp(TwitterActivity.java:45)`
有谁知道这个类是否可以在 jtwitter/Android 中使用,或者如何使这个类可用?