Date: 2020jun18
OS: Android
Language: Java
Q. Android: How to have a full screen dialog
A. Probably, you tried:
android:layout_width="match_parent"
android:layout_height="match_parent"
In the XML layout. But it didn't work. That's because the window
is too small. Set the *window* to be full screen like this:
public class MyDlg extends Dialog {
// ...
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mydlg);
// ...
getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
}
}