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
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 ...
Yes, this way works. Thanks. However, the problem of Tag contaning the Title should be fixed in B4XMenuPlus lib.
 
Upvote 0
Top