
- First of all add a dialog component.
- In ButtonOnclick event(which button you want use for exit) add some block like given below.

- First add Dialog set massage block.
- after that add Ok button click block.
- than give name yes to ok button and inside of this block add finish activity block.
- after that add Cancel button block named No.
- and in the last add Dialog show block.