0

I am creating a Dialog like this:

 dialog = new Dialog(Start.this);
 dialog.setContentView(R.layout.wait);
 dialog.setTitle(null);
 DisplayMetrics metrics = new DisplayMetrics();
 getWindowManager().getDefaultDisplay().getMetrics(metrics);
 getWindow().setLayout( metrics.widthPixels, metrics.heightPixels);
 dialog.show();

But it is not really full-screen, it has that dialog edge around it. Is there a way to completly set it to full screen?

user934779
  • 303
  • 1
  • 8
  • 14

2 Answers2

1

If you look at the very first question in the related section on the right, you'll see this question: Android Borderless Dialog. It answers your question. You want to use a different theme instead of the default dialog theme.

Community
  • 1
  • 1
kabuko
  • 36,028
  • 10
  • 80
  • 93
0
getWindow().setLayout( metrics.widthPixels, metrics.heightPixels); 

is wrong, you need to set the Window of Dialog, not the Activity. like this:

dialog.show();
dialog.getWindow().setLayout( metrics.widthPixels, metrics.heightPixels);