I searched the forum but have not found an example of how to create a small window when you press the button of my application closes, so you can display a message that asks: "Are you sure you want to quit?"
And over the message, but always within this small window to display a banner ad.
I hope you get the idea, the app free you see very often.
I use a button to exit the application, and not the back button. I do not know if your suggestion makes it possible to bring up a pop-up window asking for confirmation to exit with a banner inside.