P PeterPetSil Member Licensed User Longtime User Oct 25, 2012 #1 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: Code: Copy 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: Code: Copy Sub Activity_Create(FirstTime As Boolean) ' Some initializations... ' ' Activity.AddMenuItem2("Info","MenuInfo",IconInfo) End Sub What am I missing? Peter
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: Code: Copy 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: Code: Copy 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 Oct 25, 2012 #2 I dont think it is possible to change the menus once they are added. It probably works on orientation change because the activity is destroyed and recreated. Maybe you can try to finish and re-start the activity. Upvote 0
I dont think it is possible to change the menus once they are added. It probably works on orientation change because the activity is destroyed and recreated. Maybe you can try to finish and re-start the activity.
P PeterPetSil Member Licensed User Longtime User Oct 25, 2012 #3 thedesolatesoul said: I dont think it is possible to change the menus once they are added. Click to expand... But there has to be a way, to remove them, right? If there isn't.... :BangHead: Upvote 0
thedesolatesoul said: I dont think it is possible to change the menus once they are added. Click to expand... But there has to be a way, to remove them, right? If there isn't.... :BangHead:
thedesolatesoul Expert Licensed User Longtime User Oct 25, 2012 #4 PeterPetSil said: But there has to be a way, to remove them, right? If there isn't.... :BangHead: Click to expand... 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
PeterPetSil said: But there has to be a way, to remove them, right? If there isn't.... :BangHead: Click to expand... 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.