I have code from a previous Android app which I successfully integrated with Twitter. I've copied this code over to a new app and changed the callback-url, consumer-key and consumer-secret for my new app.
Using the twitter4j library I'm able to get my RequestToken and authentication url as follows:
Twitter twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer(myConsumerKey, myConsumerSecret);
RequestToken requestToken = twitter.getOAuthRequestToken(myCallbackUrl);
String authenticationUrl = requestToken.getAuthenticationURL()
The RequestToken has a non-null token value, a non-null tokenSecret value, and a null secretKeySpec value. The authentication url is of the following form:
http://api.twitter.com/oauth/authenticate?oauth_token=...
I load this url in my WebView and I see the following page:

Here I'm stuck. When I click the Sign In button, just this same page keeps loading up. Nothing else. When I click the Cancel button however, I see the following page:

Only on this page when I click the Return to Fan League Beko BBL button is my callback-url invoked, with a denied parameter which has my oauth_token as its value. Anyone seen anything like this before and know what might be stopping my sign in request from being processed???
Update 1: I've tried the authentication url and the
Sign Inbutton from a desktop browser and it works as expected, processing the response and then invoking the callback-url. It's just failing when trying it in theWebViewof my Android app. I've tried it on multiple Android devices and tablets. JavaScript is enabled on myWebViewtoo so that's not it. Ideas most welcome. I'm out of ideas!Update 2: I've just done some debug-mode code-tracing on my
WebView'sWebViewClientand I'm seeing that when I click theSign Inbutton, theshouldOverrideUrlLoading(WebView webView, String url)method is not called, but the following three methods are called (in order):onPageStarted(WebView view, String url, Bitmap favicon),onLoadResource(WebView view, String url),onPageFinished(WebView view, String url). Theurlvalue these methods have is:https://api.twitter.com/oauth/authenticate, i.e. theoauth_tokenparameter has been stripped off the authenticate url. Maybe this is aPOSTrequest being treated as aGETrequest and hence why this one same page keeps loading up? Any ideas what I can do to have thisSign Inbutton press processed properly?
