I copied the example from https://github.com/ddewaele/AndroidTwitterSample. The only change I made was updating the jar files that were used (from 2.1.11 to 2.2.5). Apparantly that makes a difference.
When I run the following code
String token = prefs.getString(OAuth.OAUTH_TOKEN, "");
String secret = prefs.getString(OAuth.OAUTH_TOKEN_SECRET, "");
AccessToken a = new AccessToken(token,secret); //Exception thrown here
Twitter twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer(Constants.CONSUMER_KEY, Constants.CONSUMER_SECRET);
twitter.setOAuthAccessToken(a);
I get an exception when trying to create the AccessToken
java.lang.IllegalArgumentException: Invalid access token format.
Since the user is trying to authenticate twitter for the first time, the token and secret strings are empty strings(""). Is there something obvious that I'm missing?