Here is the code to add something like in this image : a dialog (pop-up) with buttons in Android.

Normally, the user may come back to your application with the “back” button. I wanted it to be a dead-end dialog. My aim was to close the application if there is no Internet connexion at all.

More >