List of usage examples for twitter4j AsyncTwitter getOAuthRequestTokenAsync
void getOAuthRequestTokenAsync(String callbackURL);
From source file:com.marpies.ane.twitter.LoginActivity.java
License:Apache License
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mStopped = false;/*from w w w .j a v a2s.c o m*/ Bundle extras = getIntent().getExtras(); boolean forceLogin = extras.getBoolean(EXTRA_PREFIX + ".forceLogin"); /* If we have access tokens (user has logged in before) */ if (TwitterAPI.hasAccessTokens()) { AIR.log("User is already logged in"); AIR.dispatchEvent(AIRTwitterEvent.LOGIN_ERROR, "User is already logged in"); finish(); } /* Get new access tokens */ else { final AsyncTwitter twitter = TwitterAPI.getAsyncInstance(); twitter.addListener(getOAuthRequestTokenListener(forceLogin)); twitter.getOAuthRequestTokenAsync(TwitterAPI.getCallbackURL()); } }