Activity problems

techknight

Well-Known Member
Licensed User
Longtime User
I have that slider library running and setup on my app. But for some strange reason, things arent being executed or executed properly:

B4X:
Sub Activity_Create(FirstTime As Boolean)
   If FirstTime Then
      admin.Initialize("admin")
      serial1.Initialize("serial1")
      If admin.IsInitialized = False Then
         ToastMessageShow("Bluetooth not Installed, Device Unsupported", True)
      End If
   End If   
   Activity.Title = "RCSE ScoreAll"

   'Initialize the panels we use for the pages and put them in the container
   container.Initialize
   
   Activity.SetBackgroundImage(bmp)
   
   Activity.AddMenuItem("Connect","mnuConnect")
   Activity.AddMenuItem("Disconnect","mnuDisconnect")

   ReadConfig
   
   SetDisplay
   
   'TmrExpired.Enabled = True   
   DoEvents
   
   'Put in rest of menu items 
   Activity.AddMenuItem("DIM", "mnuDimming")
   Activity.AddMenuItem("Clear Board","mnuClear")
   DoEvents
   
End Sub

That code works fine, until you get to the last 2 addmenuitems. They dont run..... My Connect/Disconnect is added to the menu. The panel/container slide gets loaded and displayed with those 2 subroutines i call. But then for some reason the last 2 menu items never load...

any ideas?
 

JonPM

Well-Known Member
Licensed User
Longtime User
What's the reason for loading those two menu items after the 2 routines? Why not just load all 4 together?
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
because i dont want users to push those buttons before the panel is loaded. Its a bluetooth based app the communicates to a product and the product returns a code back to the app to pick which interface to load. Once the interface is loaded, THEN i want to add the menu buttons.
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
What I've done in my apps is to have a panel and put buttons on it so it looks like the menu.

I can change anything I like on any of the buttons. I've made the text bold so it's more readable.

I capture the menu press in the Activity_Keypress event and show/hide the panel.

Anywhere in code you can enable or disable and even change color of any of the buttons.

regards, Ricky
 
Upvote 0
Top