M mauro vicamini Active Member Licensed User Longtime User Feb 10, 2016 #1 Hi Everyone! I've a problem: I've an application that open a menu clicking on an image calling Activity.OpenMenu. Everything works great on Android prior 5.0 , on my Android 5.0.2 (Samsung Galaxy Tab A) it doesn't appear when I click on the image. Is it a bug or do I have to consider something more (maybe something in manifest or some other option)? Thanks.
Hi Everyone! I've a problem: I've an application that open a menu clicking on an image calling Activity.OpenMenu. Everything works great on Android prior 5.0 , on my Android 5.0.2 (Samsung Galaxy Tab A) it doesn't appear when I click on the image. Is it a bug or do I have to consider something more (maybe something in manifest or some other option)? Thanks.
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2016 #2 Try it in a new project, with this code: Code: Copy Sub Activity_Create(FirstTime As Boolean) Activity.AddMenuItem("asdasd", "aaa") Activity.AddMenuItem("asdasd", "aaa") Activity.AddMenuItem("asdasd", "aaa") End Sub Sub Activity_Click Activity.OpenMenu End Sub Does it work? Upvote 0
Try it in a new project, with this code: Code: Copy Sub Activity_Create(FirstTime As Boolean) Activity.AddMenuItem("asdasd", "aaa") Activity.AddMenuItem("asdasd", "aaa") Activity.AddMenuItem("asdasd", "aaa") End Sub Sub Activity_Click Activity.OpenMenu End Sub Does it work?
M mauro vicamini Active Member Licensed User Longtime User Feb 10, 2016 #3 Erel said: Try it in a new project, with this code: Code: Copy Sub Activity_Create(FirstTime As Boolean) Activity.AddMenuItem("asdasd", "aaa") Activity.AddMenuItem("asdasd", "aaa") Activity.AddMenuItem("asdasd", "aaa") End Sub Sub Activity_Click Activity.OpenMenu End Sub Does it work? Click to expand... yes it works! So why in my project doesn't work? I do Activity.AddMenuItem like you do in Activity_Create and I call Activity.OpenMenu in image_click event, nothing more. What could it be the problem? Upvote 0
Erel said: Try it in a new project, with this code: Code: Copy Sub Activity_Create(FirstTime As Boolean) Activity.AddMenuItem("asdasd", "aaa") Activity.AddMenuItem("asdasd", "aaa") Activity.AddMenuItem("asdasd", "aaa") End Sub Sub Activity_Click Activity.OpenMenu End Sub Does it work? Click to expand... yes it works! So why in my project doesn't work? I do Activity.AddMenuItem like you do in Activity_Create and I call Activity.OpenMenu in image_click event, nothing more. What could it be the problem?
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2016 #4 Hard to say. Make sure that the targetSdkVersion is set to 14+ in the manifest editor. Upvote 0
M mauro vicamini Active Member Licensed User Longtime User Feb 10, 2016 #5 Erel said: Hard to say. Make sure that the targetSdkVersion is set to 14+ in the manifest editor. Click to expand... I confirm that targetSdkVersion is set to 14. Upvote 0
Erel said: Hard to say. Make sure that the targetSdkVersion is set to 14+ in the manifest editor. Click to expand... I confirm that targetSdkVersion is set to 14.
M mauro vicamini Active Member Licensed User Longtime User Feb 10, 2016 #6 I think to have found the problem: the diference between your example and my application is that in may application the Activity is set with #IncludeTitle: false. If i do the same with your example it doesn't works, exactly like my app. But calling Activity.OpenMenu in an Activity with no title works on previous Android versions, also in devices without hardware menu button. Upvote 0
I think to have found the problem: the diference between your example and my application is that in may application the Activity is set with #IncludeTitle: false. If i do the same with your example it doesn't works, exactly like my app. But calling Activity.OpenMenu in an Activity with no title works on previous Android versions, also in devices without hardware menu button.
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2016 #7 The menu is part of the action bar (title). It will not work without it. Note that there are several good alternatives to the standard menu. For example: https://www.b4x.com/android/forum/threads/14563/#content Upvote 0
The menu is part of the action bar (title). It will not work without it. Note that there are several good alternatives to the standard menu. For example: https://www.b4x.com/android/forum/threads/14563/#content
Erel B4X founder Staff member Licensed User Longtime User Mar 3, 2016 #8 No. However you can provide your own button and the call Activity.OpenMenu. Upvote 0
M mauro vicamini Active Member Licensed User Longtime User Mar 4, 2016 #9 Rick Harris said: Indeed this is the way I used to do it and all was OK, but I am afraid that this also does not work anymore in Android version 5.0 and higher. If the title (activity) bar is hidden then calling Activity.OpenMenu does NOT open any menu! I know this 100% sure because I was getting complaints from customers that they could not open the Menu in my apps. So I did a number of experiments. Click to expand... You are right Rick! It's the same I've experienced and made me open this thread. Upvote 0
Rick Harris said: Indeed this is the way I used to do it and all was OK, but I am afraid that this also does not work anymore in Android version 5.0 and higher. If the title (activity) bar is hidden then calling Activity.OpenMenu does NOT open any menu! I know this 100% sure because I was getting complaints from customers that they could not open the Menu in my apps. So I did a number of experiments. Click to expand... You are right Rick! It's the same I've experienced and made me open this thread.
Erel B4X founder Staff member Licensed User Longtime User Mar 4, 2016 #10 I've tested it on Android 6 and it does work. The menu appears from the bottom of the screen. Make sure to test it with the material theme (don't set any specific theme). Upvote 0
I've tested it on Android 6 and it does work. The menu appears from the bottom of the screen. Make sure to test it with the material theme (don't set any specific theme).
Erel B4X founder Staff member Licensed User Longtime User Mar 6, 2016 #11 I've used this manifest: Code: Copy AddManifestText( <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:anyDensity="true"/>) SetApplicationAttribute(android:icon, "@drawable/icon") SetApplicationAttribute(android:label, "$LABEL$") It will work on all devices running Android 2.0+. Upvote 0
I've used this manifest: Code: Copy AddManifestText( <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:anyDensity="true"/>) SetApplicationAttribute(android:icon, "@drawable/icon") SetApplicationAttribute(android:label, "$LABEL$") It will work on all devices running Android 2.0+.