Android Question B4XMenuPlus with Emojis

Tareq Khan

Member
Licensed User
Longtime User
I am getting the contents of Title in the Tag variable in B4XPage_MenuClick(Tag As String). The following code works. is Emoji the problem? Please suggest the bestway to use emojis in B4XMenuPlus. Thanks.

B4X:
Private Sub AddMenuItems
    b4xmp.Initialize(Me, Root, "MenuClickTopMenu")

    
    b4xmp.AddItem("Logout", "πŸšͺ Logout")
    b4xmp.AddItem("Delete Account", "πŸ—‘οΈ Delete Account")
    'b4xmp.AddSeparator
    b4xmp.AddItem("Privacy Statement", "πŸ” Privacy Statement")
    b4xmp.AddItem("Terms of Service", "πŸ“œ Terms of Service")
    b4xmp.AddItem("Licenses", "πŸ“„ Licenses")
    'b4xmp.AddSeparator
    b4xmp.AddItem("About RASTA", "ℹ️ About RASTA")

    ' Show the menu, need it to build
    b4xmp.ShowMenu
End Sub


Private Sub B4XPage_MenuClick(Tag As String)
    'ISSUE: Tag is containing Title. is Emoji the problem?
    Select Case Tag
        Case "πŸ” Privacy Statement"
            Log("πŸ” Privacy Statement clicked")
            B4XPages.ShowPage("Privacy")

        Case "πŸ“œ Terms of Service"
            Log("πŸ“œ Terms of Service clicked")
            

        Case "πŸ“„ Licenses"
            Log("πŸ“„ Licenses clicked")
            B4XPages.ShowPage("License")

        Case "πŸšͺ Logout"
            Log("πŸšͺ Logout clicked")
            

        Case "πŸ—‘οΈ Delete Account"
            Log("πŸ—‘οΈ Delete Account clicked")
            
        Case "ℹ️ About"
            Log("ℹ️ About clicked")
            

        Case Else
            Log("❓ Unknown menu tag: " & Tag)
    End Select
End Sub
 

stevel05

Expert
Licensed User
Longtime User
If you're saying it is displaying OK, but not matching the Tag in the Select statement you could try:

B4X:
Select True
    Case Tag.EndsWith("Privacy Statement")
        Log(Tag & " Clicked")
        B4XPages.ShowPage("Privacy")

    Case Tag.EndsWith("Terms of Service")
       etc ...
 
Upvote 0

Tareq Khan

Member
Licensed User
Longtime User
Yes, this way works. Thanks. However, the problem of Tag contaning the Title should be fixed in B4XMenuPlus lib.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…