四个警报对话框同时出现,我希望在遇到计时器方法时将它们全部删除。我应该怎么办?
AlertDialog.Builder mainBuilder = new AlertDialog.Builder(AdminViewActivity.this);
mainBuilder.setMessage("Table No " +TableList.get(i)+" At Time "+TimeList.get(i))
.setPositiveButton("Waiter Called", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id) {
dailog1=dialog;
dialog.dismiss();
}
});
AlertDialog mainAlert = mainBuilder.create();
mainAlert.requestWindowFeature(Window.FEATURE_NO_TITLE);
WindowManager.LayoutParams WMLP = mainAlert.getWindow().getAttributes();
mainAlert.getWindow().getAttributes().gravity = Gravity.LEFT|Gravity.CENTER_VERTICAL;
WMLP.x = 10; //x position
WMLP.y = 300; //y position
mainAlert.getWindow().setAttributes(WMLP);
mainAlert.show();