Using AddMenuItem to pass a variable

thughesimsuk

Member
Licensed User
Longtime User
So I have a load of menu items that get created from a Database, on the click event of one of the menu items I want to pass a ref number,

B4X:
     Activity.AddMenuItem("Item 123", "MenuItem(123))
     Activity.AddMenuItem("Item 124", "MenuItem(124))

sub MenuItem_Click(reference as int)

    msgbox("The ref is : "&reference ,"Ref")

end sub

What am I doing wrong? any takers?

P.s. I know that the sender value would give me the menu text i.e. 'Item 124'
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…