Android : Dialog occupy 100% width
<pre><code> final Dialog dialog = new Dialog(this, R.style.theme_dialog);
 dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
 dialog.setContentView(R.layout.dialog_name);
 dialog.setCancelable(false);

 dialog.getWindow().setGravity(Gravity.TOP);
 dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
</code></pre>

<p>Above code occupy around 90% width but I want 100 percent.</p>