public void onBackPressed(@NonNull DialogPlus dialogPlus) {
    if (onCancelListener != null) {
      onCancelListener.onCancel(DialogPlus.this);
    }
    dismiss();
  }
public void onBackPressed ( @ NonNull DialogPlus dialogPlus ) { if ( onCancelListener != null ) { onCancelListener . onCancel ( DialogPlus . this ) ; } dismiss ( ) ; }
Invoked when back button is pressed. Automatically dismiss the dialog.