title: twitter Login Callback android app
body: <p>I'm trying to login on twitter from my android app using Twitter4j library but it crashes when the callback is called... and appears this screen:  the page is not disponible</p>
  
  <p>this is my code:</p>
  
  <pre><code>        public class TwitterLogin extends Activity {
      /** Called when the activity is first created. */
  
      Twitter twitter;
      RequestToken requestToken;
  
      /*
      * Calls the OAuth login method as soon as its started
      */
          @Override
          public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
      //      setContentView(R.layout.main);
              OAuthLogin();
          }
  
      /*
      * - Creates object of Twitter and sets consumerKey and consumerSecret
      * - Prepares the URL accordingly and opens the WebView for the user to provide sign-in details
      * - When user finishes signing-in, WebView opens your activity back
      */
          void OAuthLogin() {
              try {
                  twitter = new TwitterFactory().getInstance();
                  twitter.setOAuthConsumer(TwitterConstants.CONSUMER_KEY,TwitterConstants.CONSUMER_SECRET_KEY);
                  requestToken = twitter.getOAuthRequestToken(TwitterConstants.CALLBACK_URL);
                  Log.w("TwitterLogin requestToken callbackUrl: "+requestToken.toString());
      //          requestToken = twitter.getOAuthRequestToken(OAuth.OUT_OF_BAND);
      //          String pin = requestToken.getParameter(OAuth.OAUTH_VERIFIER);
                  String authUrl = requestToken.getAuthenticationURL();
                  Log.w("TwitterLogin requestToken authUrl: "+authUrl);
                  this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));
                  Log.w("TwitterLogin despres del startActivity intent");
                  } catch (TwitterException ex) {
                  Toast.makeText(this, ex.getMessage(), Toast.LENGTH_LONG).show();
                  Log.e("in Main.OAuthLogin", ex.getMessage());
              }
          }
  
  
      /*
      * - Called when WebView calls your activity back.(This happens when the user has finished signing in)
      * - Extracts the verifier from the URI received
      * - Extracts the token and secret from the URL
      */
          @Override
          protected void onNewIntent(Intent intent) {
              super.onNewIntent(intent);
              Log.w("TwitterLogin  dintre del onNewIntent");
              Uri uri = intent.getData();
  
              Log.w("TwitterLogin uri: "+uri.toString());
  
                  if (uri != null &amp;&amp; uri.toString().startsWith(TwitterConstants.CALLBACK_URL)){
  
                      try {
                          String verifier = uri.getQueryParameter("oauth_verifier");
                          Log.w("TwitterLogin","onNewIntent oauth_verifier: "+verifier);
                          AccessToken accessToken = twitter.getOAuthAccessToken(requestToken, verifier);
                          Log.w("TwitterLogin","onNewIntent accesToken: "+accessToken.toString());
                          String token = accessToken.getToken(), secret = accessToken.getTokenSecret();
                          displayTimeLine(token, secret); //after everything, display the first tweet
  
                      } catch (TwitterException ex) {
                          Log.e("Main.onNewIntent", "" + ex.getMessage());
                      }
                  }
  
          }
  
      /*
      * Displays the timeline's first tweet in a Toast
      */
  
          @SuppressWarnings("deprecation")
          void displayTimeLine(String token, String secret) {
              if (null != token &amp;&amp; null != secret) {
                  List&lt;Status&gt; statuses = null;
                  try {
                      twitter.setOAuthAccessToken(token, secret);
                      statuses = twitter.getFriendsTimeline();
                      Toast.makeText(this, statuses.get(0).getText(), Toast.LENGTH_LONG)
                      .show();
                  } catch (Exception ex) {
                      Toast.makeText(this, "Error:" + ex.getMessage(),
                      Toast.LENGTH_LONG).show();
                      Log.d("Main.displayTimeline",""+ex.getMessage());
                  }
  
              } else {
                  Toast.makeText(this, "Not Verified", Toast.LENGTH_LONG).show();
              }
          }
      }
  </code></pre>
  
  <p>if someone can help me please, I've been trying to login on Twitter 2 days and I don't know how to solve this. </p>
  
  <p>Thanks</p>