我创建AlertDialog
、设置setOnCanceledOnTouchOutside
和setCancelable
参数,然后单击它隐藏的外部对话框。也许有人可以帮助我?
dialog = new AlertDialog.Builder(getContext()).setView(table).setTitle(R.string.order_start_title)
.setNegativeButton(R.string.dialog_cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
onOrderStartCancel(context);
}
}).setPositiveButton(R.string.dialog_start_order, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
onOrderStart(context, goodsTypeId, goodType);
}
}).create();
dialog.setCanceledOnTouchOutside(true);
dialog.setCancelable(true);
dialog.show();