Skip to content

Instantly share code, notes, and snippets.

@tsmsogn
Last active December 10, 2015 17:18
Show Gist options
  • Select an option

  • Save tsmsogn/4467018 to your computer and use it in GitHub Desktop.

Select an option

Save tsmsogn/4467018 to your computer and use it in GitHub Desktop.
[android]Full screen dialog
// 'dialog' is Dialog object
dialog.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
dialog.show();
// 'dialog' is Dialog object
dialog.show();
Window window = dialog.getWindow();
WindowManager.LayoutParams currentDialogAttributes = window.getAttributes();
WindowManager.LayoutParams newDialogAttributes = new WindowManager.LayoutParams();
newDialogAttributes.copyFrom(currentDialogAttributes);
newDialogAttributes.width = WindowManager.LayoutParams.FILL_PARENT;
newDialogAttributes.height = WindowManager.LayoutParams.FILL_PARENT;
window.setAttributes(newDialogAttributes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment