protected Boolean doInBackground(String... params) {
// TODO Auto-generated method stub
Boolean isSuccess = false;
try {
//Consumer key
String consumerKey = STATICVALUES.consumerKey;
//Consumer secret
String consumerSecret = STATICVALUES.consumerSecret;
twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer(consumerKey ,consumerSecret);
AccessToken accessToken = new AccessToken(params[0], params[1]);
twitter.setOAuthAccessToken(accessToken);
twitter.updateStatus(params[2]);
Log.e("TAG", "true");
isSuccess = true;
}
catch (TwitterException e) {
isSuccess = false;
Log.e("TAG", "fail");
e.printStackTrace();
}
return isSuccess;
}
这是我的代码。我使用 twitter4j-2.0.2 核心。如你所知,我有一个错误,关于 api 1.1 的错误,所以我添加了 twitter4j 3.0.3 核心,但没有任何改变。
我搜索 twitter api 1.1,但有人只是添加了 twitter4j 3.0.3 核心,有人需要将 xml 更改为 json。
我写信到编辑框,然后单击按钮,此文本发送 tiwtter。我能做些什么?我需要帮助!