Android Question [SOLVED] Dialog in Dialog

rosippc64a

Active Member
Licensed User
Longtime User
Hi All,
I have a dialog with and edit field, a combobox and an info button. If I click the info button, I shows an info dialog. When I close this second info dialog with its ok button, the first dialog is also closes. How can I prevent this?

Thanks in advance
Stefan
Main dialog:
    ...
    dialog.Title = IIf(bKedv,"Nyugtavégi kedvezmény","Borravaló")
    Dim p As B4XView = XUI.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 100%x, 150dip)
    p.LoadLayout("szamlavegiKedvezmenydlg")
    lblDialogHeader.Text = IIf(bKedv,"Megadhat kedvezményt a teljes nyugtára!","Adja meg a borravaló mértékét!")
    edtDlgValue.Text = NumberFormat2(szlengedmeny,1,2,0,False)
    Private ime As IME
    ime.Initialize("xx")
    ime.ShowKeyboard(edtDlgValue)
    'ime.SetLengthFilter(edtDlgValue,3)
    edtDlgValue.RequestFocus
    edtDlgValue.SelectAll
    cmbDlgAfter.mBase.Visible = True
    If bKedv Then
        cmbDlgAfter.SetItems(Array As String("%","HUF"))
    Else
        cmbDlgAfter.SetItems(Array As String("%","HUF","FELKEREKÍT"))
    End If
    cmbDlgAfter.SelectedIndex = szlakedvsz
    ime.SetCustomFilter( edtDlgValue, edtDlgValue.INPUT_TYPE_NUMBERS, "1234567890")
    dialog.PutAtTop = True 'put the dialog at the top of the screen
    Wait For (dialog.ShowCustom(p, "OK", "", "MÉGSE")) Complete (Result As Int)
    If Result = XUI.DialogResponse_Positive Then
    ...
Info part:
Private Sub lblInfo_Click
    Private ime As IME
    ime.Initialize("xx")
    ime.HideKeyboard
    Private xdialog As B4XDialog
    xdialog.Initialize (Activity)
    xdialog.Title = "INFO"
    Private LongTextTemplate As B4XLongTextTemplate
    LongTextTemplate.Initialize
    LongTextTemplate.Text = $"A megadható érték háromféle lehet:
%: a nyugta végössegének adott része,
HUF: FIX összeg,
FELKEREKÍT: csak borravaló esetén, a nyugta végösszege és a megadott összeg közötti rész.
Ezek között úgy lehet váltani, hogy kattint az értéktől jobbra látható szövegen."$
    LongTextTemplate.CustomListView1.DefaultTextBackgroundColor = XUI.Color_White
    LongTextTemplate.CustomListView1.DefaultTextColor = XUI.Color_Black   
    Wait For (xdialog.ShowTemplate(LongTextTemplate, "OK", "", "")) Complete (Result As Int)
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top