Question Detail

I have tried many variants to create full-screen dialog but I couldn't. How to create customize DialogBox. I need something, like this : 

Qna full-screen dialogs android open animation

Please Help me for creating this type of Dialog Box.


Thread Reply

Anonymous

- 1 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();

Anonymous

- 3 months 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);