Skip to content

Instantly share code, notes, and snippets.

@mustafasevgi
Created February 2, 2015 09:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mustafasevgi/c67548e0512c4dde748b to your computer and use it in GitHub Desktop.
Save mustafasevgi/c67548e0512c4dde748b to your computer and use it in GitHub Desktop.
Full screen dialog fragment
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
// the content
final RelativeLayout root = new RelativeLayout(getActivity());
root.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
// creating the fullscreen dialog
final Dialog dialog = new Dialog(getActivity());
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(root);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.WHITE));
dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
return dialog;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment