Dim dlg As B4XDialog
dlg.Initialize(Root)
Dim rs As ResumableSub = dlg.Show("Message", "Do it", "Do other", "")
Dim Base As B4XView = dlg.Base
Dim lblText As B4XView = Base.GetView(2).GetView(0)
lblText.SetLayoutAnimated(0, 10dip, 0dip, Base.Width - 20dip, 40dip)
Dim FirstButton As B4XView = dlg.GetButton(xui.DialogResponse_Positive)
FirstButton.SetColorAndBorder(xui.Color_Green, 1, xui.Color_White, 8dip)
FirstButton.TextColor = xui.Color_White
Dim FirstButtonTop As Int = lblText.Top + lblText.Height
FirstButton.SetLayoutAnimated(0, 10dip, FirstButtonTop, Base.Width / 2, 40dip)
Dim SecondButton As B4XView = dlg.GetButton(xui.DialogResponse_Negative)
SecondButton.SetColorAndBorder(xui.Color_Red, 1, xui.Color_White, 8dip)
SecondButton.TextColor = xui.Color_White
Dim SecondButtonTop As Int = FirstButton.Top + FirstButton.Height + 10dip
SecondButton.SetLayoutAnimated(0, 10dip, SecondButtonTop, Base.Width / 2, 40dip)
Wait For (rs) Complete (Result As Int)
Select Result
Case xui.DialogResponse_Positive
'Do it
Log("Do it")
Case xui.DialogResponse_Negative
'Do other
Log("Do other")
' Case xui.DialogResponse_Cancel
' Log("Don't do anything")
End Select