Android Question Nested dialogs

Mostez

Well-Known Member
Licensed User
Longtime User
Hello,
I have 'BrowseWhat' activity shows B4Xdialog1 ('SQLbrowser' layout) with B4Xdatatable, when I long click on data row, it shows B4Xdialog2('RowBrowser' layout), but when I exit B4Xdialog2, it should go back to SQLbrowser dialog, but it goes to BrowseWhat !! all code below in BrowseWhat activity module.

I want to correct this sequence.

I use this code to call dialog 1

B4X:
Sub lstvBrowseWhat_ItemClick (Position As Int, Value As Object)
    
    Dim SQLstring As String
    Select Value
        Case BROWSE_INDEX_VEHICLES
            SQLstring ="SELECT * FROM MOBILE_VEHICLES_SEARCH"
        Case BROWSE_INDEX_TRAILERS
            SQLstring ="SELECT * FROM MOBILE_TRAILERS_SEARCH"
        ....
        ....
    End Select
    
    SQLBrowse (SQLstring)
    
End Sub

B4X:
private Sub SQLBrowse(SQL As String)

    Starter.SQLqueryString = SQL
    
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 340dip, 520dip)
    p.LoadLayout("SQLDataBrowser")
    SQLdialog.Initialize(Activity)
    SQLdialog.Title = "e-trip"
    SQLdialog.PutAtTop = True
    
    Wait For (CallSub(Starter, "GetQueryResultSet")) Complete (Exist As Boolean)
    If Exist Then
        .....
        ......
    SQLdialog.PutAtTop = True 'put the dialog at the top of the screen
    Wait For (SQLdialog.ShowCustom(p, "OK", "", "")) Complete (Result As Int)
    'just do nothing after OK
End Sub
I use this code to call dialog 2
B4X:
Sub tblDataBrowserTable_CellLongClicked (ColumnId As String, RowId As Long)
    
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 340dip, 520dip)
    p.LoadLayout("RowBrowser")
    
    RowDialog.Initialize(Activity)
    RowDialog.Title = "e-trip"
    RowDialog.PutAtTop = True
    
    lstRowBrowser.TwoLinesLayout.Label.TextColor = Colors.LightGray
    lstRowBrowser.TwoLinesLayout.Label.TextSize = 18
    lstRowBrowser.TwoLinesLayout.SecondLabel.TextColor = Colors.White
    lstRowBrowser.TwoLinesLayout.SecondLabel.TextSize = 20
    lstRowBrowser.Clear
    lstRowBrowser.Visible = True
    
    .....
    .....
    
    Wait For (RowDialog.ShowCustom(p, "OK", "", "")) Complete (Result As Int)
    'just do nothing

End Sub
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…