1

I want to tweet in blackberry. I am able to login after I am getting illegal exception.

I have used the below code for tweeting. Please suggest me.

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);
                    }
4

1 回答 1

1
Token token = new Token(token, tokenSecret);
Credential cj = new Credential(name, consumerKey,consumerSecret, token);
m = UserAccountManager.getInstance(cj);
  if (m.verifyCredential()
       {
          Tweet t = new Tweet("Hi!!! ");
      TweetER ter = TweetER.getInstance(m);
      t = ter.post(t); 
        } 
    else {
          Dialog.alert("Error");      
          }
于 2012-05-24T06:48:04.183 回答