Activity.
AddMenuItem (Title As CharSequence, EventName As String)
Adds a menu item to the activity.
Title - Menu item title.
EventName - The prefix name of the sub that will handle the click event.
This method should only be called inside sub Activity_Create.
Note that the 'Sender' value inside the click event equals to the clicked menu item text.
Example:
Activity.AddMenuItem("Open File", "OpenFile")
...
Sub OpenFile_Click
...
End Sub
B4A Code Snippet FontAwesome To Bitmap - Erel    
Jul 16, 2018   
(18 reactions)   
tags: UIUnlike an older "TextToBitmap" sub that you can find in the forum, this code vertically centers the icon.
It can also be used in B4J and B4i (only need to change the font line).
Sub Activity_Create(FirstTime As Boolean)
'usage example
Activity.AddMenuItem3("Android", "Test", FontAwesomeToBitmap(Chr(0xF17B), 28), True)
Activity.AddMenuItem3("Eye", "Test", FontAwesomeToBitmap(Chr(0xF06E), 28), True)
End Sub
Sub FontAwesomeToBitmap...
B4A Question TabStripViewPager - Activity.AddMenuItem3 - beeblomarv    
Sep 5, 2016")
Activity.AddMenuItem3("Connect","Connect",LoadBitmap(File.DirAssets...,"sadasdasd")
Activity.AddMenuItem3("Connect","Connect",LoadBitmap(File...
link: Can I change the menu item once it has been set?
Not with the standard menu implementation....
link: this really isn't helping ... so I ask you really simple question-
I need to add a menu item...
link: -modifyable-and-advanced-menu.49128/#content...
B4A Question Activity.AddmenuItem2 - How does it work? - Erel (first post)    
Sep 22, 2020   
(1 reaction)
But then what is AddMenuitem2 for?
AddMenuItem3 was added when the action bar was introduced. No reason to use AddMenuItem or AddMenuItem2.
And shouldn't icons come out alongside texts?
No. This is how Android menus work....
link: If i write:
Activity.AddMenuItem2("Menu 1","Menu", LoadBitmap(File...
Italian Activity.AddmenuItem2 non escono le icone - Sabotto    
Sep 18, 2020Se scrivo
Activity.AddMenuItem2("Menu 1","Menu", LoadBitmap(File.DirAssets, "imgMenu1.png"))
Activity.AddMenuItem2("Menu 2","Menu", LoadBitmap(File.DirAssets, "imgMenu2.png"))
Activity.AddMenuItem2("Menu 3","Menu... testi, senza icone
Activity.AddMenuItem3("Menu 11","Menu", LoadBitmap(File.DirAssets, "imgMenu1.png"),True)
Activity.AddMenuItem3("Menu 22"...
B4A Question i can't see icones with Activity.AddMenuItem2 - Rachbob (first post)    
Jul 8, 2020Ok. Merci pour votre soutien....
link: This is how menus look in Android. You either show an icon on the action bar or text inside...
link: ="test"
Activity.AddMenuItem3("Client","clt",LoadBitmap(File.DirAssets...
link: You should use AddMenuItem3 and set the add to action bar to true....
B4A Question how to hide menu items created by Activity.AddmenuItem3 - Fayez Boulos (first post)    
Mar 8, 2019Thanks Great Erel, your post solved my problem I can have now a better handle on the menus and changing them dynamically through code. here is Erel post.... I am grateful to you guys...
link: Thanks DonManfred
I tried the project in the link, however it complains of unknown type ACmenu and i...
link: -modifyable-and-advanced-menu.49128/...
link: I found one interesting post regarding this point posted by Erel, I will start reading it now... wis...
B4A Question Activity.AddMenuItem - set conditionally each time the activity is resumed - DonManfred (first post)    
Jun 20, 2018   
(1 reaction)Search appcompat Tutorial about changeable menus...
link:
Activity.AddMenuItem("Add new", "MenuItem_AddNewExercise")
End If
If...
B4A Question Activity.AddMenuItem change text on event - DonManfred (first post)    
Aug 1, 2018   
(2 reactions)No.
Use appcompat and check the changeable menu tutorial...
link: .AddMenuItem("Samples","Samples_fun")
and by any event change the string "Samples...
B4A Question BUG - Activity.AddMenuItem2 - Cableguy    
Jul 25, 2011I've used this before in V1.50 with no problems, but in v1.60 seems to not be working...
Activity.AddMenuItem2("Setup","Setup")',LoadBitmap(File.DirAssets,"setup...
link: Hi
sorry
I'll try to formulate the problem more exactly
when ready I'll start a new thread
...
link: This is a thread from 2011. Please start a new one instead....
link: example:
'Activity.LoadLayout("Layout1")
Activity.AddMenuItem2("info...
B4A Question No Activity.AddMenuItem after CallSub from Service - further discussion - Erel (first post)    
May 16, 2018See Activity.AddMenuItem documentation. It must be called inside Activity_Create....
link: Hey
I am relating to: https://www.b4x.com/android/forum/threads/no-activity-addmenuitem-after...
Page: 1  
2  
3  
4  
5  
6  
7