Can you fire an event when Android Dialog is dismissed?

前端 未结 6 1192
一整个雨季
一整个雨季 2020-12-11 00:33

Say I have a created a dialog in my Android app like so:

private static ProgressDialog dialog;
dialog = ProgressDialog.show(MainActivity.this, \"\", \"Downlo         


        
6条回答
  •  独厮守ぢ
    2020-12-11 01:06

    Whenever a dialog is closed either by clicking PositiveButton, NegativeButton, NeturalButton or by clicking outside of the dialog, "onDismiss" is always gets called automatically so do your stuff inside the onDismiss() method e.g.,

    @Override
    public void onDismiss(DialogInterface dialogInterface) {
        ...
    }
    

    You don't even need to call dismiss() method.

提交回复
热议问题