Activity.Openmenu and Android 4.2

tdocs2

Well-Known Member
Licensed User
Longtime User
Hello and greetings to all. Newbie or Junior in trouble...

Activity.Openmenu and Android 4.2 on Nexus 7 direct USB connection

In code below, refer to Activity_Create and Activity.AddMenuItem3("Settings", "settings_topmenu", Null, True) 'opens overflow menu.

Problem
Menu click on Settings Menu does not work (does not open Overflow menu) with Release or Release Obfuscated or executed from Apps. It only works with Debug. I am using B4A v 2.3 (same problem with v 2.2).

The code works fine on another tablet running 4.04 connected via wireless B4A Bridge or executed from Apps.

Baffling! Help please.

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")

Activity.AddMenuItem3("Narrow Search", "narrow_search_menu",Null,False)
Activity.AddMenuItem3("Build Search", "build_search_menu",Null,False)
Activity.AddMenuItem3("Search Hints", "search_hints_menu",Null,False)
Activity.AddMenuItem3("Search", "search_menu",Null,True)
Activity.AddMenuItem3("Settings", "settings_topmenu", Null, True) 'opens overflow menu

End Sub


Sub settings_topmenu_click
'Msgbox ("open menu","")

Activity.OpenMenu 'open overflow menu
End Sub
 

tdocs2

Well-Known Member
Licensed User
Longtime User
Problem solved

Thank you, Erel.

Your code solved the problem.

By introducing a delay (which I apparently did when I used the Debug feature - by newbie chance and not by design), the code is given a chance to execute?

Best regards.

Sandy
 
Upvote 0
Top