私はAndroidアプリを開発しています。
計算が行われている間、ダイアログウィンドウは数秒間フォアグラウンドにとどまるため、ユーザーがボタンを押した後、[OK] ボタンを非表示にしたいと思います。
これはコードです:
new AlertDialog.Builder(this)
.setMessage("This may take a while")
.setPositiveButton("OK", new android.content.DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// hide the OK button - how?
// a lot of computation
}
})
.show();
どうすればそれを達成できますか?
PS: 計算を処理するためのより高度な手法 (進行状況ダイアログ、マルチスレッドなど) には興味がありません。
ありがとう。