我在Alert框中调用AsyncTask是按钮点击, 但是,在点击3到5次警报对话框关闭后,alertdialog没有关闭,其弹出窗口仍保留在屏幕上。任何人都可以解释我的问题
AlertDialog.Builder mainBuilder = new AlertDialog.Builder(this);
mainBuilder.setMessage(""+getResources().getString(R.string.tvOrderConfirmDialog))
.setPositiveButton(""+getResources().getString(R.string.btnYes), new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
order();
UploadOrder uploadData = new UploadOrder(ArabicMainMenuActivity.this);
uploadData.execute("http://192.168.1.6/dat/insert.php");
}
})
.setNegativeButton(""+getResources().getString(R.string.btnNo), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog mainAlert = mainBuilder.create();
mainAlert.show();