title: uri.getQueryParameter() returning null value
body: <p>I have the following code in a class:</p>
  
  <pre><code>@Override
          public boolean shouldOverrideUrlLoading(WebView wv, String url)
          {
              if (url.startsWith(Constants.OAUTH_REDIRECT))
              {
                  Uri uri = Uri.parse(url);
  
                  String state = uri.getQueryParameter("state");
  
                  if (state != null &amp;&amp; state.equals(Constants.randString))
                  {
                      String error = uri.getQueryParameter("error");
  
                      if (error != null &amp;&amp; error.length() &gt; 0)
                      {
                          if (error.equals("access_denied"))
                          {
                              //user chose not to login
                              Log.d("oAuthView", "Access Denied");
                              finish();
                          }
                          else
                          {
                              Toast.makeText(getApplicationContext(), error, Toast.LENGTH_LONG).show();
                              finish();
                          }
                      }
  
                      //Go back to MainActivity with authorization code
                      Intent resultIntent = getIntent();
                      resultIntent.putExtra("authCode", uri.getQueryParameter("code"));
  
                      setResult(RESULT_OK, resultIntent);
  
                      finish();
  
                      return true;
                  }
              }
              return false;
          }
  </code></pre>
  
  <p>For some reason I am getting a null value when trying to capture "state", even though I have made sure that it is in the URL.  This means the app never enters the if statement that follows. I have also checked and the same thing happens when I try to capture the authCode.  Any ideas on why they would return null?</p>
  
  <p>Edit: For some reason when I try an alternative URL scheme, it parses correctly.</p>
  
  <p>The URL I need to parse but doesn't work:
  <a href="http://www.website.com/#access_token=tokenstringhere&amp;token_type=bearer&amp;state=randomStringHere&amp;expires_in=3600&amp;scope=identity+submit" rel="nofollow">http://www.website.com/#access_token=tokenstringhere&amp;token_type=bearer&amp;state=randomStringHere&amp;expires_in=3600&amp;scope=identity+submit</a></p>
  
  <p>A similar URL that does work:
  <a href="http://www.website.com/?state=cnmdr6&amp;code=tokenStringHere" rel="nofollow">http://www.website.com/?state=cnmdr6&amp;code=tokenStringHere</a></p>
  
  <p>What would cause the first parse to fail but the second one to properly parse?</p>