title: Views on Custom dialog not showing
body: <p>I have a custom dialog which acts as both <code>waitDialog</code> and <code>ErrorDialog</code>. It's a transparent dialog. it does appear over the activity but the only problem is that view i add on it at run time are not showing. Below is the code:</p>
  
  <p>MultiPurposeDialog.java</p>
  
  <pre><code>public class MultiPurposeDialog extends Dialog {
  
      int dialogType;
      String dialogMessage;
      private TextView tvMessage;
      private ImageView ivDialog;
      private Button bDismissDialog;
  
      public MultiPurposeDialog(Context context) {
          super(context, R.style.TransparentProgressDialog);
  
          // DIALOG USER_INTERFACE TEMPLATE
          WindowManager.LayoutParams wmLayoutParams = getWindow().getAttributes();
          wmLayoutParams.gravity = Gravity.CENTER_HORIZONTAL;
          getWindow().setAttributes(wmLayoutParams);
          setTitle(null);
          setCancelable(false);
          setOnCancelListener(null);
          LinearLayout layout = new LinearLayout(context);
          layout.setOrientation(LinearLayout.VERTICAL);
          LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                  LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
          // DIALOG'S VIEWS
          tvMessage = new TextView(context);
          ivDialog = new ImageView(context);
          bDismissDialog = new Button(context);
          bDismissDialog.setText("Okay");
          bDismissDialog.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  dismiss();
              }
          });
  
          layout.addView(ivDialog);
          layout.addView(tvMessage);
          layout.addView(bDismissDialog);
  
      }
  
      @Override
      public void show() {
          super.show();
          switch (dialogType) {
          case Constants.DIALG_CODE_WAIT:
  
  
              ivDialog.setImageResource(R.drawable.common_signin_btn_icon_light);
              tvMessage.setText(dialogMessage);
              bDismissDialog.setVisibility(View.GONE);
  
              // ROTATE WAIT ICON IF IT'S A WAIT DIALOG BOX
              RotateAnimation anim = new RotateAnimation(0.0f, 360.0f,
                      Animation.RELATIVE_TO_SELF, .5f,
                      Animation.RELATIVE_TO_SELF, .5f);
              anim.setInterpolator(new LinearInterpolator());
              anim.setRepeatCount(Animation.INFINITE);
              anim.setDuration(2000);
              ivDialog.setAnimation(anim);
              ivDialog.startAnimation(anim);
              break;
          case Constants.DIALOG_CODE_ERROR:
  
              ivDialog.setImageResource(android.R.drawable.ic_dialog_alert);
              tvMessage.setText(dialogMessage);
              bDismissDialog.setVisibility(View.VISIBLE);
              break;
          }
      }
  
      public void setDialogType(int dialogType) {
          this.dialogType = dialogType;
      }
  
      public void setDialogMessage(String dialogMessage) {
          this.dialogMessage = dialogMessage;
      }
  
  }
  </code></pre>
  
  <p>Style.xml</p>
  
  <pre><code> &lt;style name="TransparentProgressDialog" parent="@android:Theme.Dialog"&gt;
          &lt;item name="android:windowFrame"&gt;@null&lt;/item&gt;
          &lt;item name="android:windowBackground"&gt;@android:color/transparent&lt;/item&gt;
          &lt;item name="android:windowIsFloating"&gt;true&lt;/item&gt;
          &lt;item name="android:windowContentOverlay"&gt;@null&lt;/item&gt;
          &lt;item name="android:windowTitleStyle"&gt;@null&lt;/item&gt;
          &lt;item name="android:windowAnimationStyle"&gt;@android:style/Animation.Dialog&lt;/item&gt;
          &lt;item name="android:windowSoftInputMode"&gt;stateUnspecified|adjustPan&lt;/item&gt;
          &lt;item name="android:backgroundDimEnabled"&gt;true&lt;/item&gt;
          &lt;item name="android:background"&gt;@android:color/transparent&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>
  
  <p>In the MainActivity.java i am doing this</p>
  
  <pre><code>multiPurposeDialog = new MultiPurposeDialog(context);
              multiPurposeDialog.setDialogType(Constants.DIALOG_CODE_ERROR);
              multiPurposeDialog.setDialogMessage("Hello");
              multiPurposeDialog.show();
  </code></pre>
  
  <p>Where i am doing it wrong?
  thanks</p>