Closing a custom alert dialog on button click

前端 未结 10 1236
灰色年华
灰色年华 2020-12-06 04:01

I\'m having trouble closing my alert dialog. I am using a layout inflator to make the dialog, so I\'m not sure how I would go about closing the thing after I\'m done with it

10条回答
  •  情歌与酒
    2020-12-06 04:55

    Try this:

    btn_go_anyway.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v)
        {
            getDialog().dismiss();
        }
    });
    

提交回复
热议问题