Getting web page title from setWebViewClient?
<p>i am using webview in my android app.
i want to get title of current page shown in webview.
i am using following code to do that</p>

<pre><code>webView.setWebViewClient(new WebViewClient()
        {
            public void onPageFinished(WebView view, String url) {

                TextView t=(TextView)findViewById(R.id.title); 
                t.setText(view.getTitle());

            }
        }
</code></pre>

<p>This code works but not always.
Sometimes it doesn't show the title.
sometimes it shows title of previous page.
Whats wrong here??</p>
