In the system, the activity whose theme is dialog cannot always be full of full screen. Sometimes full screen is required for screen adaptation. The solution is found on stackoverflow:
@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.your_layout); getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);}
Full screen must be set after setcontentviw, otherwise it will not take effect.
The style of the translucent activity is attached.
<Style name = "transcutestyle" parent = "@ Android: style/theme. Dialog">
<Item name = "Android: windowframe"> @ Android: color/transparent </item> <! -- Border -->
<Item name = "Android: incluwisfloating"> true </item> <! -- Whether to float above the activity -->
<Item name = "Android: javaswistranslucent"> true </item> <! -- Translucent -->
<Item name = "Android: windownotitle"> true </item> <! -- No title -->
<Item name = "Android: windowbackground"> @ Android: color/transparent </item> <! -- Transparent background -->
<Item name = "Android: backgrounddimamount"> 0.3 </item>
<Item name = "Android: windowanimationstyle"> @ null </item>
</Style>
Stackoverflow Original article in this: http://stackoverflow.com/questions/1362723/how-can-i-get-a-dialog-style-activity-window-to-fill-the-screen