title: set width of custom dialog to wrap content android
body: <p>I want to set the width of custom dialog to wrap content 
  but always it fill all the width of the screen</p>
  
  <p>I have tested this</p>
  
  <pre><code>android.view.WindowManager.LayoutParams params = mydialog.getWindow().getAttributes();
  params.width = android.view.WindowManager.LayoutParams.WRAP_CONTENT;
  mydialog.getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
  </code></pre>
  
  <p>and that</p>
  
  <pre><code>mydialog.getWindow().setLayout(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
  </code></pre>