アプリにアプリ内ブラウザーを実装したいと考えています。AlertDialog.Builder オブジェクト内で WebView を使用して表示することを実現しました。
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 のタイトルを動的に変更したい。