Programming Tips - Android: full screen dialog

Date: 2020jun18 OS: Android Q. Android: full screen dialog A. Of course, 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); } }