There is already an overflow menu, if that is what you are referring to. I am wanting to have an separate menu popup when the filter icon is selected, so yes another menu is needed. The ACPopupMenu requires a view when it is initialized and the closest view I can think of is the toolbar itself which puts it way too far from the icon the popup menu is associated with. If the filter icon is a view, then that would work perfectly, but I cannot determine if or how to refer to the filter icon as a view.
There is already an overflow menu, if that is what you are referring to. I am wanting to have an separate menu popup when the filter icon is selected, so yes another menu is needed. The ACPopupMenu requires a view when it is initialized and the closest view I can think of is the toolbar itself which puts it way too far from the icon the popup menu is associated with. If the filter icon is a view, then that would work perfectly, but I cannot determine if or how to refer to the filter icon as a view.
What I do is create a very small transparent panel which is 2 X 2 pixels and locate it at activity.width and 0 y. Use that panel as the popup's reference view. I have also adjusted the Y to the height of the toolbar if you want the popup below the toolbar.
You can add a custom view instead of a standard menu item:
B4X:
Dim b As Button
b.Initialize("menuButton")
b.Text = "Click"
ACToolBarLight1.AddView(b, 60dip, 40dip, Gravity.CENTER)
pp.Initialize("pp", b) 'global ACPopupMenu
pp.AddMenuItem(0, "Item 1", Null)
pp.AddMenuItem(0, "Item 2", Null)
pp.AddMenuItem(0, "Item 3", Null)
End Sub
Sub MenuButton_Click
pp.Show
End Sub