shouldOverrideUrlLoading is called eventhough there is no url loaded in webview
<p>I used webviewclient class for my Twitter authentication.</p>

<p>Code is below</p>

<p>private class TwitterWebViewClient extends WebViewClient {</p>

<pre><code>@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {

    Log.d(TAG, "Redirecting URL " + url);

    if (url.startsWith(TwitterApp.CALLBACK_URL)) {
        mListener.onComplete(url);
        Log.e("starts","starts with");
        TwitterDialog.this.dismiss();

        return true;
    }  else if (url.startsWith("authorize")) {

        Log.e("authorize","authorization");
        return false;
    }

    return true;
}

@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
    Log.d(TAG, "Page error: " + description);

    super.onReceivedError(view, errorCode, description, failingUrl);

    mListener.onError(description);

    TwitterDialog.this.dismiss();
}

@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
    Log.e("page started in",url);
    Log.d(TAG, "Loading URL: " + url);
    super.onPageStarted(view, url, favicon);
    mSpinner.show();
}

@Override
public void onPageFinished(WebView view, String url) {
    Log.e("finish","pagefinished");
    super.onPageFinished(view, url);
    String title = mWebView.getTitle();
    if (title != null &amp;&amp; title.length() &gt; 0) {
        Log.e("title","settitle");
        mTitle.setText(title);
    }
    mSpinner.dismiss();
}
</code></pre>

<p>}</p>

<p>--->  <code>public boolean shouldOverrideUrlLoading(WebView view, String url)</code> </p>

<p>is called when I executed for second time.At that time there is no url loaded in webview,but still it is called.</p>

<p>----> </p>

<pre><code>first time there is no problems,execution is done well in the order 
                     1)   onpage started
                     2)   onpagefinish
                     3)   shouldOverrideUrlLoading (is called when I do enter my username,password and presses Authorize button,so only when there is another url loaded then only this method is called)

 But I didnt understand why for the second time  ( shouldOverrideUrlLoading()) gets called . Did I need to clear anything in the class?

please help

Thanks in advance 
</code></pre>
