Problems with menus

PeterPetSil

Member
Licensed User
Longtime User
Hi!

I got stucked at updating the activity on resume.

I'm using PreferenceActivity lib to handle user settings.

So, when settings are closed, I want to redraw user interface within Activity_Resume.

My code:
B4X:
Sub Activity_Resume
     Activity_RemoveAllViews
     Activity_Create (False)
End Sub

Everything works fine (Labels, text boxes, etc), except Menus. Menus are not changing at all. When I change the orientation of my device, the menus change to the correct version (depends on settings).

I'm adding menus in Activity_Create sub:

B4X:
Sub Activity_Create(FirstTime As Boolean)

     ' Some initializations...
     '
     '

     Activity.AddMenuItem2("Info","MenuInfo",IconInfo)
End Sub

What am I missing?

Peter
 

thedesolatesoul

Expert
Licensed User
Longtime User
But there has to be a way, to remove them, right? If there isn't.... :BangHead:
There is not. Just have a search of the forum.
http://www.b4x.com/forum/basic4android-updates-questions/20429-remove-menu.html#post117703
http://www.b4x.com/forum/basic4android-updates-questions/12744-menu-remove.html#post71856
http://www.b4x.com/forum/basic4android-updates-questions/20715-clear-menu.html#post119490
http://www.b4x.com/forum/basic4andr...37-how-do-you-modify-menuitems.html#post48636

At the current point, however using Menus is not standard practice anymore.
I am not sure how it works, but the new B4A supports the overflow menu which I think adds menus in the same way with AddMenuItem, so I think thats a no-go if you want to modify menus.
Try using AHQuickActions, ICSMenuPopup or some other way to displaying the menu.
 
Upvote 0
Top