每当用户在编辑文本中输入文本时,我都会尝试发送推文,然后可以将其转换为字符串,然后发送推文。但是我无法发送它。我怎么能这样做?这是我的代码
public void onClick1(View v) {
//String status = editTextStatus.getText().toString();
String token ="token";
String secret = "secret";
AccessToken a = new AccessToken(token,secret);
Twitter twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer("auth", "auth secret");
twitter.setOAuthAccessToken(a);
try {
//String status1 = editTextStatus.getText().toString();
twitter.updateStatus(editTextStatus.getText().toString());
} catch (TwitterException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}