AlertDialog setOnDismissListener not working

前端 未结 6 1373
孤独总比滥情好
孤独总比滥情好 2021-02-19 11:44

My activity opens a dialog. When it closes I need the function ReloadTable() to be executed. So I am trying to use setOnDismissListener but its not get

6条回答
  •  情书的邮戳
    2021-02-19 12:30

    You have to setOnCancelListener to the AlertDialog.Builder:

    AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
                    this);
    alertDialogBuilder.setOnCancelListener(new DialogInterface.OnCancelListener() {
                @Override
                public void onCancel(DialogInterface dialog) {
                    dialogmenu = false;
                }
            })
    

提交回复
热议问题