我使用jtwitter库通过Twitter授权我的应用程序。我使用此http://marakana.com/forums/android/examples/312.html进行身份验证,推文和读取状态..身份验证和阅读状态正常。但是点击Tweet按钮会得到以下异常。哪里错了?请帮我。
/* Responsible for posting new status to Twitter */
class PostStatusTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... params) {
try {
twitter.setStatus(params[0]);
return "Successfully posted: " + params[0];
} catch (Exception e) {
e.printStackTrace();
return "Error connecting to server.";
}
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
Toast.makeText(MainActivity.this, result, Toast.LENGTH_LONG).show();
}
}
LOGACT:
W/System.err(3073): http://api.twitter.com/1/statuses/update.json (anonymous)
W/System.err(3073): at winterwell.jtwitter.URLConnectionHttpClient.processError(URLConnectionHttpClient.java:176)
W/System.err(3073): at winterwell.jtwitter.OAuthSignpostClient.post(OAuthSignpostClient.java:129)
W/System.err(3073): at winterwell.jtwitter.Twitter.updateStatus(Twitter.java:3220)
W/System.err(3073): at winterwell.jtwitter.Twitter.updateStatus(Twitter.java:3161)
W/System.err(3073): at winterwell.jtwitter.Twitter.setStatus(Twitter.java:2917)
W/System.err(3073): at com.tarams.twitterdemo.MainActivity$PostStatusTask.doInBackground(MainActivity.java:244)
W/System.err(3073): at com.tarams.twitterdemo.MainActivity$PostStatusTask.doInBackground(MainActivity.java:1)
W/System.err(3073): at android.os.AsyncTask$2.call(AsyncTask.java:185)
W/System.err(3073): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
W/System.err(3073): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
W/System.err(3073): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
W/System.err(3073): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
W/System.err(3073): at java.lang.Thread.run(Thread.java:1096)