Is there any way to make my Dialog view full screen, i.e dialog occupy the entire screen (like an Activity). I tried using the LayoutParams and styles like
The answer does not work for me(sdk 21, samsung galaxy s5). After searching and testing, I find that the key point for setting a dialog for fullscreen is the in your dialog style. Most styles of Dialog in sdk set it true! Set it false in a style and use it in
AlertDialog.Builder = new AlertDialog.Builder(getActivity(), R.style.YourStyle);
your style may look like
after setting it false, it should be fullscreen. And more, you can use
dialog.getWindow.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
to set it's height to wrap_content. Hope to help someone.