Android Question Activity.Addmenu not poping up

tsteward

Well-Known Member
Licensed User
Longtime User
Using activity add menu to create menu doesn't work on all devices.

My Asus Transformer tablet, a clients Motorola Xoom running Android 4.1.2

Pressing the physical Menu button won't raise the menu.
I created a button with Activity.OpenMenu in the onlick event but still no menu.
It does work on my Galaxy S2 and most other devices.

Any idea how I fix this?
 

tsteward

Well-Known Member
Licensed User
Longtime User
You should ask this question to those who have the same device :(.

Sorry for my stupid question: are you sure that the routine of the button is called? Have you tried to put a breakpoint on Activity.OpenMenu?
Really I should have asked somewhere else?
Yes the event is triggered. Testing by placing breakpoint and when executed No Menu :(
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
Hello Erel,
I create the menu in Activity_Create as so:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Dim lc As LicenseChecker
    Dim p As PhoneId
    Dim ph As Phone
   
    Activity.LoadLayout("Main")
    Activity.AddMenuItem("About","About")
    Activity.AddMenuItem("Settings", "Settings")
    Activity.AddMenuItem("DB Updates?", "UpdateDB")

I have sold 60 odd apps and just a few report this problem of not being able to bring up the menu so I created a button to do so with the following but on some devices like my tablet - no menu:
B4X:
Sub BtnMenu_Click
    Activity.OpenMenu
End Sub
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I think it is useful to make absurd attempts when I can not find solutions.

In this case, I would try removing (temporarily) the LicenseChecker library, because it is special.

Then, I wonder why you declare it, Phone and PhoneId in Activity_Create rather than the Globals.

(Finally, because I'm careless and simultaneously picky, I do not recommend to use P as a variable name).
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
I think it is useful to make absurd attempts when I can not find solutions.

In this case, I would try removing (temporarily) the LicenseChecker library, because it is special.

Then, I wonder why you declare it, Phone and PhoneId in Activity_Create rather than the Globals.

(Finally, because I'm careless and simultaneously picky, I do not recommend to use P as a variable name).
Tried removing license nothing still....
Fair comment re variable names and taken on board

Just as a test, if you have not done so already, you can edit the Manifest and try:

<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8"/>
This makes the menu work on my ASUS. Just for testing. The other option is do what I did and use the SlideMenu class.
Yes editing the Manifest does get the menu working but I need versions 11 or greater so thats not really a solution.

HELP!!!!!!!!!!!!!
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
New project created and menu works fine just using activity.addmenuitem("Menu1","Menu")

So what could I have done...
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
easier said then done as app is huge but I'll try
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
Thanks for your time & effort Erel.
That sucks. Will look at using the slide menu more then.

Thanks everyone.
 
Upvote 0
Top