As I understand it, this is how a modal dialog behaves, at least in B4A. One thing you can do is set a boolean variable to True when the dialog is presented and False after the user chooses an option or cancels it. When you are restoring the state after device rotation, check the value of the variable and if True, show the dialog again.