Hi guys.
I'm quite a :sign0104: on B4A but I'm learning fast. At least I get things done now on Android with B4A as opposed to using java etc.
I have been using the possibility to add menu items in my project. Although I only really used one MenuItem I added three of them in my program(s).
This seemed to work well for some versions of my app, but without modifying the code that has to do with defining the menu items and then acting to them, it suddenly doesn't work anymore.
Now when I push the Menu, the app automatically and immediately closes.
These lines are used to define the menu items :
And these lines should deal with pushing the menu and choosing an item :
I have been trying to move the code over the module, but the place does not seem to be important.
Using debug I can follow the initialization-code, but the actual response-code will never execute. No use to set a breakpoint there, it never gets there anyway.
Anyone has a clue?:sign0163:
BasicBert.
I'm quite a :sign0104: on B4A but I'm learning fast. At least I get things done now on Android with B4A as opposed to using java etc.
I have been using the possibility to add menu items in my project. Although I only really used one MenuItem I added three of them in my program(s).
This seemed to work well for some versions of my app, but without modifying the code that has to do with defining the menu items and then acting to them, it suddenly doesn't work anymore.
Now when I push the Menu, the app automatically and immediately closes.
These lines are used to define the menu items :
B4X:
'MenuItem Stop
Activity.AddMenuItem("Stop", "mnuStop")
'MenuItem Open
Activity.AddMenuItem("Open", "mnuOpen")
'MenuItem Instellingen
Activity.AddMenuItem("Instellingen", "mnuInstellingen")
And these lines should deal with pushing the menu and choosing an item :
B4X:
Sub mnuStop_Click
Dim Answ As Int
Answ = Msgbox2("Wilt U afsluiten?", "A T T E N T I E", "Ja","", "Nee", LoadBitmap(File.DirAssets, "AGlogo.jpg"))
If Answ = DialogResponse.POSITIVE Then
Activity.Finish
End If
lblMessage.Color = Colors.Red
End Sub
Sub mnuOpen_Click
lblMessage.Color = Colors.Yellow
End Sub
Sub mnuInstellingen_Click
lblMessage.Color = Colors.White
Dim Answ As Int
Answ = Msgbox2("Weergeven indien niet voorradig?", "A T T E N T I E", "Ja","?", "Nee", LoadBitmap(File.DirAssets, "AGlogo.jpg"))
If Answ = DialogResponse.POSITIVE Then
ShowNulResterend = True
VulListView
Else
If Answ = DialogResponse.NEGATIVE Then
ShowNulResterend = False
VulListView
End If
End If
End Sub
I have been trying to move the code over the module, but the place does not seem to be important.
Using debug I can follow the initialization-code, but the actual response-code will never execute. No use to set a breakpoint there, it never gets there anyway.
Anyone has a clue?:sign0163:
BasicBert.