This answer is incorrect.
Use Theme.Dialog.Alert
From themes.xml :
<style name="Theme.Dialog.Alert" parent="@android:style/Theme.Dialog"> <item name="windowBackground">@android:color/transparent</item> <item name="windowTitleStyle">@android:style/DialogWindowTitle</item> <item name="windowIsFloating">true</item> <item name="windowContentOverlay">@null</item> </style>
Then it can be applied in XML layout or Android manifests, as here :
<activity android:theme="@android:style/Theme.Dialog.Alert">
Or an operation using setTheme(int) . However, this does not seem to be recommended. A simple code example shown in this error message .
source share