My Android game (NativeActivity) opens a system dialog with an EditText field for text entry. The dialog opens fine and the text is editable, but when I select some text in order to cut/copy, the EditText context menu appears to draw outside its bounds and I don't understand why.
I've attached two images. The first one shows the dialog when it opens. The second one shows what happens when text is selected and the context menu pops open.
Here's my styles.xml file.
<resources>
<!-- Popup Dialog Theme -->
<style name="MyDialogTheme" parent="Theme.AppCompat.DayNight.Dialog.Alert">
<item name="android:windowBackground">@color/MyDialogBackground</item>
<item name="android:textColorHint">@color/MyDialogLabel</item>
<item name="android:textColor">@color/MyDialogText</item>
<item name="android:dialogCornerRadius">24dp</item>
<item name="android:backgroundTint">@color/MyDialogBackground</item>
<item name="android:backgroundTintMode">src_over</item>
<item name="android:alpha">0.9</item>
</style>
asked Jul 10, 2025 at 0:12
Bungles
2,3293 gold badges34 silver badges63 bronze badges
default
Dialog? That looks like what happens whenandroid:backgroundis set in the theme, which causes that background to be set on everyView. It's often confused forandroid:windowBackground.