我想在黑莓里发推特,
我用下面的代码发推特 请建议我
protected class MyBrowserFieldListener extends BrowserFieldListener {
public void documentLoaded(final BrowserField browserField, Document document
throws Exception {
//Dialog.alert("Loaded");
if(i==1){
//Dialog.alert("111");
String c=OAuth.accessToken();
//Dialog.alert(c);
if(c.equals("200")){
Token token = new Token(Const.token, Const.tokenSecret);
Credential cj = new Credential(Const.name,
Const.consumerKey,Const.consumerSecret, token);
m = UserAccountManager.getInstance(cj);
if (m.verifyCredential()) {
Const.persistentHashtable.put("Token", l);
Const.persistentHashtable.put("Token_Secret", Const.tokenSecret);
Const.persistentHashtable.put("uam", m);
try{
Tweet t = new Tweet("jomymaratt", "Hi!!! Now I can send DM.");
TweetER ter = TweetER.getInstance(m);
t = ter.send(t);
}