2013-11-03 23 views
4

我想在我的應用程序中實現應用程序瀏覽器。爲了實現我在AlertDialog.Builder對象中使用WebView並顯示它。如何在顯示AlertDialog.Builder後更改標題?

final AlertDialog.Builder alert = new AlertDialog.Builder(context); 

現在我有一個問題,我希望AlertDialog.Builder的標題顯示在頁面加載的進度,所以我重寫onProgressChanged功能,並試圖如下重置標題:

wv.setWebChromeClient(new WebChromeClient() { 
    public void onProgressChanged(WebView view, int progress) { 
     alert.setTitle("Loading..." + progress + "%"); 
    tv.setText("Loading..." + progress + "%"); 
    view.setVisibility(View.GONE); 
    if (progress == 100) { 
     alert.setTitle(title);// THIS DOES NOT HAVE ANY EFFECT 
     tv.setVisibility(View.GONE);//THIS IS "LOADING..." string, That I have written as make shift for the time being 
     view.setVisibility(View.VISIBLE);//This displays the WebView when it if loaded. 
    } 
} 
}); 

我想讓AlertDialog.Builder標題動態變化。

回答