Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("1")
MainDialog.Initialize(Root)
'removed
'SecondDialog.Initialize(root)
MainDialog.Title = "Example"
CustomPanel = xui.CreatePanel("")
CustomPanel.SetLayoutAnimated(0, 0, 0, 300dip, 300dip)
CustomPanel.LoadLayout("CustomLayout")
End Sub
Sub btnShowDialog_Click
Dim rs As Object = MainDialog.ShowCustom(CustomPanel, "Ok", "", "")
Log(MainDialog.Base.Parent.Tag) 'produces "b4xdialog_background"
'removed
'MainDialog.Base.Parent.Tag = "" 'this will prevent the dialog from closing when the second dialog appears.
Wait For (rs) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
End If
End Sub
Sub DialogButton_Click
Dim Btn As B4XView = Sender
'inserted
SecondDialog.Initialize(MainDialog.Base)
Wait For (SecondDialog.Show("Delete button?", "Yes", "No", "")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
Btn.RemoveViewFromParent
End If
End Sub