How can I get a Dialog style activity window to fill the screen?

I found the solution:

In your activity which has the Theme.Dialog style set, do this:

public void onCreate(Bundle savedInstanceState) {


    getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

It’s important that you call Window.setLayout() after you call setContentView(), otherwise it won’t work.

Leave a Comment