Android Question StdActionBarHelper popmenu wrong position

apty

Active Member
Licensed User
Longtime User
When i use the code below, the popupmenu does not work as intended, i think because of the activity.height. How can i fix it so that it shows in correct position?

B4X:
Dim context As JavaObject
    context.InitializeContext
    Dim window As JavaObject = context.RunMethod("getWindow", Null)
    window.RunMethod("addFlags", Array(0x80000000)) 'FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
    window.RunMethod("addFlags", Array(0x00000200)) 'FLAG_LAYOUT_NO_LIMITS
    Activity.Height = GetDeviceLayoutValues.Height + 48dip
 

apty

Active Member
Licensed User
Longtime User
AppCompat also behaves the same way. Menus for a button at topright for example, show outside the screen. If I remove the code below, it works well but i need to use this code:
B4X:
Dim context As JavaObject
    context.InitializeContext
    Dim window As JavaObject = context.RunMethod("getWindow", Null)
    window.RunMethod("addFlags", Array(0x80000000)) 'FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
    window.RunMethod("addFlags", Array(0x00000200)) 'FLAG_LAYOUT_NO_LIMITS
    Activity.Height = GetDeviceLayoutValues.Height + 48dip

Is there a way to use the above code and still show popup menu correctly positioned on a view?
 
Upvote 0
Top