List of usage examples for twitter4j AsyncTwitter getOAuthAccessTokenAsync
void getOAuthAccessTokenAsync(RequestToken requestToken, String oauthVerifier);
From source file:com.marpies.ane.twitter.data.TwitterAPI.java
License:Apache License
public static void getAccessTokensForPIN(String PIN) { final AsyncTwitter twitter = getAsyncInstance(); twitter.addListener(new TwitterAdapter() { @Override/*from ww w . j av a2 s.c om*/ public void gotOAuthAccessToken(AccessToken token) { AIR.log("Retrieved access tokens"); /* Store access tokens */ TwitterAPI.storeAccessTokens(token); AIR.dispatchEvent(AIRTwitterEvent.LOGIN_SUCCESS); } @Override public void onException(TwitterException te, TwitterMethod method) { if (method == TwitterMethod.OAUTH_ACCESS_TOKEN) { AIR.dispatchEvent(AIRTwitterEvent.LOGIN_ERROR, StringUtils.removeLineBreaks(te.getMessage())); } } }); twitter.getOAuthAccessTokenAsync(mRequestToken, PIN); }