Basically the question is stated in the title. Any preferences in using one or another? Maybe some specific tasks where one is superior/ more efficient/ better than the other?
Modal windows, by their nature, are compulsory and require the user to act immediately. Since the dialogs place the system in a different mode, users cannot continue what they are doing until they acknowledge the dialog.
AlertDialog is a lightweight version of a Dialog. This is supposed to deal with INFORMATIVE matters only, That's the reason why complex interactions with the user are limited. Dialog on the other hand is able to do even more complex things .
A message box is a modal dialog box and the system creates it by using the same internal functions that DialogBox uses. If the application specifies an owner window when calling MessageBox or MessageBoxEx, the system disables the owner.
Menus allow us to efficiently group/hide similar options together so that the screen does not become cluttered. Dialog Boxes allow us to momentarily take the user's attention away from the main window so as to obtain information or ask questions which are required at specific points in the application.
Dialog
"A dialog
is a small window that prompts the user to make a decision or enter additional information. A dialog does not fill the screen and is normally used for modal events that require users to take an action before they can proceed."
AlertDialog
has many variants and as far as I can assume your problem, You can have a cross button too in the top-right corner of the dialog (You can set the icons anywhere, as you can provide a custom layout to an AlertDialog).
-Capable of adding any view
-Easy to edit
-Can be adapted to tablets or cellphones in landscape or portrait just by modifying the layout
-Can dedicate a whole new class just to modify it your way
PopupWindows
"This class represents a popup window
that can be used to display an arbitrary view. The popup window is a floating container that appears on top of the current activity."
PopupWindow
is another tool to customize your custom pop up anywhere in the screen. If you're showing this popup always in the middle of the screen, then I would like to suggest not to use this. The AlertDialog should work fine.
-Simpler
-Easier to code
-It's more standard so it'll be harder for the user to be confused with it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With