title: How to get size of a custom dialog in android?
body: <p>I have a custom Dialog which is extended from dialog.
  in order to place component on it, I need to know the width of the dialog. how could I do it?
  Thanks</p>
  
  <p>EDIT:</p>
  
  <pre><code>public class AnswerTypeDialog extends Dialog{
      public AnswerTypeDialog(Context context) {
          super(context);
          mContext = context;
      }
  
      @Override
      protected void onCreate(final Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          init();
      }
  
      protected void init(){
          ll=(RelativeLayout) LayoutInflater.from(mContext).inflate(R.layout.answertype_layout, null);
          this.requestWindowFeature(Window.FEATURE_NO_TITLE);
          setContentView(ll);
          mWindowWidth = this.getWindow().getAttributes().width;
      }
  }
  </code></pre>
  
  <p>mWindowWidth is zero.</p>