In this article, we are going to see how to set up an Alert dialog to the back button in Android app using Android Studio. It is used to alert the user by asking if they want to close or continue. This alert dialog can be provided by us.