Small black centred rectangle at FragmentOverlay

There is a small centred thing that pops on FragmentOverlays, seen when requesting persmissions or sharing items.

I tried just with code below and it is there.
auto fragment = new FragmentOverlay();
fragment->open();

I can see in FragmentOverlay.java that android.app.DialogFragment is deprecated and wonder if it is that.

Any suggestion?

Seems like this is required at java FragmentOverlay onStart

Window window = getDialog().getWindow();
window.setBackgroundDrawableResource(android.R.color.transparent);

A more elegant fix would be to define a custom theme and apply the transparent background to all dialogues.

So add a themes.xml under res/values on Android Studio with

<?xml version="1.0" encoding="utf-8"?>

<resources>
    <style name="MyTheme" parent="android:Theme.Light.NoTitleBar">
        <item name="android:alertDialogTheme">@style/MyDialogTheme</item>
        <item name="android:dialogTheme">@style/MyDialogTheme</item>
    </style>

    <style name="MyDialogTheme" parent="@android:style/Theme.Dialog">
        <item name="android:windowBackground">@android:color/transparent</item>
    </style>
</resources>

Then in Projucer set your Android Theme as @style/MyTheme