Making an AlertDialog in Android
This is an expansion of an answer I wrote on Stack Overflow.
AlertDialogs are useful for displaying a message to a user and optionally giving them a chance to respond to it. This is the equivalent of an iOS UIAlertController (or a Flutter AlertDialog). The examples below show a basic setup for one, two, and three buttons.
One button
