title: CallBack after Twitter authentication
body: <p>I'm trying to integrate twitter to my app, but I can't seem to get it to work.</p>
  
  <p>This is my code:</p>
  
  <pre><code>public class OAuthForTwitter extends Activity {
  
      private CommonsHttpOAuthConsumer httpOauthConsumer;
      private OAuthProvider httpOauthprovider;
      public final static String consumerKey = "{removed}";
      public final static String consumerSecret = "{removed}";
      private final String CALLBACKURL = "sosInternational:///HierBenIkNu";
      private Twitter twitter;
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          doOAuth();
      }
  
      /**
       * Opens the browser using signpost jar with application specific
       * consumerkey and consumerSecret.
       */
  
      private void doOAuth() {
          try {
              httpOauthConsumer = new CommonsHttpOAuthConsumer(consumerKey, consumerSecret);
              httpOauthprovider = new DefaultOAuthProvider(
                      "http://twitter.com/oauth/request_token",
                      "http://twitter.com/oauth/access_token",
                      "http://twitter.com/oauth/authorize");
              String authUrl = httpOauthprovider.retrieveRequestToken(httpOauthConsumer, CALLBACKURL);
              this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));
          } catch (Exception e) {
              Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
          }
      }
  
      @Override
      protected void onNewIntent(Intent intent) {
  
          super.onNewIntent(intent);
  
          Uri uri = intent.getData();
          if (uri != null &amp;&amp; uri.toString().startsWith(CALLBACKURL)) {
  
              String verifier = uri
                      .getQueryParameter(oauth.signpost.OAuth.OAUTH_VERIFIER);
  
              try {
                  // this will populate token and token_secret in consumer
  
                  httpOauthprovider.retrieveAccessToken(httpOauthConsumer,
                          verifier);
  
                  // TODO: you might want to store token and token_secret in you
                  // app settings!!!!!!!!
  
                  AccessToken a = new AccessToken(httpOauthConsumer.getToken(),
                          httpOauthConsumer.getTokenSecret());
  
                  // initialize Twitter4J
  
                  twitter = new TwitterFactory().getInstance();
                  twitter.setOAuthConsumer(consumerKey, consumerSecret);
                  twitter.setOAuthAccessToken(a);
  
                  // create a tweet
  
                  Date d = new Date(System.currentTimeMillis());
                  String tweet = "#OAuth working! " + d.toLocaleString();
  
                  // send the tweet
  
                  twitter.updateStatus(tweet);
  
              } catch (Exception e) {
  
                  Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
              }
  
          }
      }
  }
  </code></pre>
  
  <p>When I'm done authenticating on the Twitter site, it should redirect me back to the app.</p>
  
  <p>But instead, I get this Page not found:</p>
  
  <p><img src="https://i.stack.imgur.com/piffm.png" alt="alt text"></p>
  
  <p>I have this in my AndroidManifest:</p>
  
  <pre><code>&lt;intent-filter&gt;  
          &lt;action android:name="android.intent.action.VIEW"&gt;&lt;/action&gt;  
          &lt;category android:name="android.intent.category.DEFAULT"&gt;&lt;/category&gt;  
          &lt;category android:name="android.intent.category.BROWSABLE"&gt;&lt;/category&gt;  
          &lt;data android:scheme="sosInternational" android:host="HierBenIkNu"&gt;&lt;/data&gt;  
      &lt;/intent-filter&gt;  
  </code></pre>
  
  <p>How can I go back to my app with the keys i get back?</p>