- 6 years ago
The easiest way I found
Dialog dialog=new Dialog(this,android.R.style.Theme_Black_NoTitleBar_Fullscreen);
dialog.setContentView(R.layout.mylayout);
dialog.show();
- 5 years ago
You have to set Height and Width to create full-screen dialog android material design. Below I have mentioned how to create full-screen custom dialog android
DisplayMetrics metrics = getResources().getDisplayMetrics(); int width = metrics.widthPixels; int height = metrics.heightPixels; dialog = new Dialog(this); dialog.setTitle("Select Your Way!"); dialog.setContentView(R.layout.fullscreen_dialog); dialog.setCancelable(true); dialog.show(); dialog.getWindow().setLayout((6 * width) / 6, WindowManager.LayoutParams.MATCH_PARENT);
Hot Questions