This question has already been answered:

enter image description here

How to remove the ActionBar from the Dialog highlighted in red?

Dialog dialog=new Dialog(getActivity()); dialog.setContentView(R.layout.block); dialog.show(); 

Using

 dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.block); dialog.show(); 

getting such a miracle. Why is that?

enter image description here

Reported as a duplicate member of the Spirit Community Mar 7 '16 at 14:42 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

    1 answer 1

    Use:

     dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.block); dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT); dialog.show(); 
    • ATP of course, but it's a bit wrong. Threw the picture. Look above what I got ..... - Andro
    • @xTIGRx add dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT); before dialog.show(); - VAndrJ
    • ATP Bro!) ..... - Andro