ContextMenu position is messed up in Android 7

I found a solution for this somewhere (can't remember where). The problem is between the new context menu and the Holo themes.

Solution Details:

I added a style in values-v24 folder that looks like:

<resources>

<style name="ContextPopupMenuStyleLight" parent="@android:style/Widget.Holo.Light.PopupMenu">
    <item name="android:overlapAnchor">true</item>
</style>

<style name="ContextPopupMenuStyleDark" parent="@android:style/Widget.Holo.PopupMenu">
    <item name="android:overlapAnchor">true</item>
</style>

<style name="AppTheme" parent="AppTheme.Common" >
    <item name="android:contextPopupMenuStyle">@style/ContextPopupMenuStyleLight</item>
</style>

Then, in my default styles.xml I used a style called

AppTheme.Common

That defines all my app style, and an empty style called

<style name="AppTheme" parent="AppTheme.Common" />

and I used that empty style as the default app style. This way, on version > 24, the app uses this extra item regarding context menu overlap anchor to fix the issue (bringing context menu to what they looked like before API 24)


If anyone still has the same problem, just add this to your theme folder (v14)

<item name="android:overlapAnchor">true</item>