Пример #1
0
 public static void setTwitterToken(AccessToken accessToken) {
   tAccessTokenObj = accessToken;
   mTwitterWebDialog.dismiss();
   mLoginProgressDialog.setMessage("login in progress..");
   mLoginProgressDialog.show();
   // mUserInfo.setAccessToken(accessToken.toString());
   getTwitterProfileInfo(tAccessTokenObj);
 }
Пример #2
0
  private void loginWithTwitterWeb() {
    ConfigurationBuilder builder = new ConfigurationBuilder();
    builder.setOAuthConsumerKey(Constants.TWITTER_CONSUMER_KEY);
    builder.setOAuthConsumerSecret(Constants.TWITTER_CONSUMER_SECRET);
    twitter4j.conf.Configuration configuration = builder.build();

    TwitterFactory factory = new TwitterFactory(configuration);
    twitter = factory.getInstance();

    CookieSyncManager.createInstance(mContext);
    CookieManager cookiemanager = CookieManager.getInstance();
    cookiemanager.removeSessionCookie();
    twitter.setOAuthAccessToken(null);

    mTwitterWebDialog = new WebDialog(mContext, twitter);
    mTwitterWebDialog.show();
  }