Android Tutorial [B4X] [XUI] Msgbox


Staff member
Licensed User
XUI library v1.4 adds support for asynchronous msgbox dialogs.

The API is simple:

xui.MsgboxAsync("Hello", "World")
The dialog is not a modal dialog. The code will not stop.
MsgboxAsync and Msgbox2Async return an object that can be used as the sender filter parameter in a Wait For call.
To wait for the dialog to being dismissed:
Wait For (xui.MsgboxAsync("Hello", "World")) Msgbox_Result (Result As Int)
Msgbox2Async provides more options:

Dim icon As B4XBitmap = xui.LoadBitmapResize(File.DirAssets, "warning.png", 60dip, 60dip, True)
Dim sf As Object = xui.Msgbox2Async("Delete file?", "Title", "Yes", "Cancel", "No", icon)
Wait For (sf) Msgbox_Result (Result As Int)
If Result = xui.DialogResponse_Positive Then
End If
You can pass Null instead of the image.
You can pass "" (empty string) to remove buttons.

Note that the icon parameter is not used in B4i.


Active Member
Licensed User
This is really usefull, iths a great Native replacement for Corwin42's Material dialogs in B4A But cross platform.

Can you please add more dialogs similar to te ones on Corwins42 lib?

Specialy Progress dialog to replace ProgressDialogShow, and iHUD And and imputdialog, to avoid custom dialogs