Android Question Override onPrepareOptionsMenu

Emme Developer

Well-Known Member
Licensed User
Longtime User
Hi!
I'm trying to override the onPrepareOptionsMenu method to hide overflow icon in toolbar.
I tried to set a null drawable, and it works, but when i add some items, icons of other menu item will change position.

Tried this code, but i get an error

Error
B4X:
B4A Version: 7.30
Parsing code.    (0.06s)
Compiling code.    (0.24s)
Compiling layouts code.    (0.01s)
Organizing libraries.    (0.00s)
Generating R file.    (0.90s)
Compiling generated Java code.    Error
B4A line: 100
End Sub
javac 1.8.0_112
src\ed\digitarch\com\pesispec.java:1324: error: <identifier> expected
Public boolean onPrepareOptionsMenu (menu menu) {
      ^
1 error

Code
B4X:
#if java
import android.support.v7.widget.Toolbar;
@Override
Public boolean onPrepareOptionsMenu (menu menu) {
    Return false;
}
#End If
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Emme Developer

Well-Known Member
Licensed User
Longtime User
I'm not sure that I understand what you are trying to do. The three dots icon will not appear if there are no menu items.
I want menu items, but I don't want 3 dot. I have 2 menu item with icons, and when press one of these I want to see an overflow menu (same that is called from 3 dots) but without seeing the 3 dot.
 
Upvote 0
Top