我一直在开发一个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:我对处理计算的更高级技术(例如:进度对话框、多线程)不感兴趣。
谢谢。