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();

I can see in that is deprecated and wonder if it is that.

Any suggestion?

Seems like this is required at java FragmentOverlay onStart

Window window = getDialog().getWindow();

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"?>

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

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

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