Android – Custom Dialog in full screen


Is there any way to make my Dialog view full screen, i.e dialog occupy the entire screen (like an Activity). I tried using the LayoutParams and styles like
<item name="android:windowFullscreen">true</item> but nothing seems to be working.

I found a way of getting rid of the Title bar, but couldn't find a way to put a dialog in full screen. So can any one suggest me a way to do it.

<?xml version="1.0" encoding="utf-8"?>
<style name="MyTheme" parent="@android:style/Theme.Dialog">
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowFrame">@null</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowBackground">@color/dialog_background</item>

Best Solution

Give its constructor a non-dialog theme, such as or

Code by @Bob.

Dialog dialog = new Dialog(context,;