Android Question Menu works on one page but not another - Please Ignore Problem solved

Smee

Well-Known Member
Licensed User
Longtime User
I can't see what is wrong here. Could anyone point me in the right direction. The code works in one module but not in another. I have tried exiting the non workingroutine right after the Root.LoadLayout("Main") executes but it makes no difference, the menu still doesn't appear

Sorry, I missed calling a piece of code,
This
B4X:
Sub UpdateImage
    #if B4A
    Sleep(0)
    B4XPages.GetManager.ActionBar.RunMethod("setDisplayHomeAsUpEnabled", Array(True))
    Dim bd As BitmapDrawable
    bd.Initialize(HamburgerIcon)
    B4XPages.GetManager.ActionBar.RunMethod("setHomeAsUpIndicator", Array(bd))
    #End If
End Sub

Not Working in B4XMainPage:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    DateTime.DateFormat="dd-MMM-yy"
    Dialog.Initialize(Root)
    MenuSetup
    B4XPages.SetTitle(Me,"Page Title")
    Root.LoadLayout("Main")
...

End Sub

Sub MenuSetup

    Drawer.Initialize(Me, "Drawer", Root, 300dip)
    Drawer.CenterPanel.LoadLayout("ASVP")
    Drawer.LeftPanel.LoadLayout("Left")
    HamburgerIcon = xui.LoadBitmapResize(File.DirAssets, "hamburger.png", 32dip, 32dip, True)
  
    ListView1.TwoLinesAndBitmap.SecondLabel.Visible=False
    ListView1.AddTwoLinesAndBitmap2("Home", "", LoadBitmap(File.DirAssets, "house-png-173.png"),20)
    ListView1.AddTwoLinesAndBitmap2("Results", "", LoadBitmap(File.DirAssets, "winner.png"),21)

#if B4i
    Dim bb As BarButton
    bb.InitializeBitmap(HamburgerIcon, "hamburger")
    B4XPages.GetNativeParent(Me).TopLeftButtons = Array(bb)
    #Else If B4J
    Dim iv As ImageView
    iv.Initialize("imgHamburger")
    iv.SetImage(HamburgerIcon)
    Drawer.CenterPanel.AddView(iv, 2dip, 2dip, 32dip, 32dip)
    iv.PickOnBounds = True
    #end if

End Sub

Working in ScoringPage:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    dd.Initialize
    xui.RegisterDesignerClass(dd)
    dialog.Initialize(Root)

    Initialise
    MenuSetup
    B4XPages.SetTitle(Me,"Page Title")
...

End Sub

Sub MenuSetup

    Drawer.Initialize(Me, "Drawer", Root, 300dip)
    Drawer.CenterPanel.LoadLayout("ASVP")
    Drawer.LeftPanel.LoadLayout("Left")
    HamburgerIcon = xui.LoadBitmapResize(File.DirAssets, "hamburger.png", 32dip, 32dip, True)
  
    ListView1.TwoLinesAndBitmap.SecondLabel.Visible=False
    ListView1.AddTwoLinesAndBitmap2("Home", "", LoadBitmap(File.DirAssets, "house-png-173.png"),20)
    ListView1.AddTwoLinesAndBitmap2("Results", "", LoadBitmap(File.DirAssets, "winner.png"),21)

  
    #if B4i
    Dim bb As BarButton
    bb.InitializeBitmap(HamburgerIcon, "hamburger")
    B4XPages.GetNativeParent(Me).TopLeftButtons = Array(bb)
    #Else If B4J
    Dim iv As ImageView
    iv.Initialize("imgHamburger")
    iv.SetImage(HamburgerIcon)
    Drawer.CenterPanel.AddView(iv, 2dip, 2dip, 32dip, 32dip)
    iv.PickOnBounds = True
    #end if
End Sub

If anyone could shed any light on this it would be much appreciated

Many Thanks
 
Last edited:
Top