rfresh Well-Known Member Licensed User Longtime User Apr 11, 2012 #1 I'm using this code to create a menu item and it works fine. My question is, is there a way I can tell if it has already been created so I don't create it twice? I currently have it in Activity_Create inside a FirstTime if statement. But I've discovered if I do an update to the app, when it loads in, the Menu popup no longer works. I have to do a forced close and then start it up again for the menu to be there. Am I doing this the right way? Thanks... Code: Copy Activity.AddMenuItem2("Info","PopupMenu_Info",LoadBitmap(File.DirAssets,"info40.png"))
I'm using this code to create a menu item and it works fine. My question is, is there a way I can tell if it has already been created so I don't create it twice? I currently have it in Activity_Create inside a FirstTime if statement. But I've discovered if I do an update to the app, when it loads in, the Menu popup no longer works. I have to do a forced close and then start it up again for the menu to be there. Am I doing this the right way? Thanks... Code: Copy Activity.AddMenuItem2("Info","PopupMenu_Info",LoadBitmap(File.DirAssets,"info40.png"))
NJDude Expert Licensed User Longtime User Apr 11, 2012 #2 Right: Code: Copy Sub Activity_Create(FirstTime As Boolean) Activity.AddMenuItem2("Info","PopupMenu_Info",LoadBitmap(File.DirAssets,"info40.png")) End Sub Wrong: Code: Copy Sub Activity_Create(FirstTime As Boolean) If FirstTime Then Activity.AddMenuItem2("Info","PopupMenu_Info",LoadBitmap(File.DirAssets,"info40.png")) End If End Sub Upvote 0
Right: Code: Copy Sub Activity_Create(FirstTime As Boolean) Activity.AddMenuItem2("Info","PopupMenu_Info",LoadBitmap(File.DirAssets,"info40.png")) End Sub Wrong: Code: Copy Sub Activity_Create(FirstTime As Boolean) If FirstTime Then Activity.AddMenuItem2("Info","PopupMenu_Info",LoadBitmap(File.DirAssets,"info40.png")) End If End Sub