title: Dialog with Button and ImageView?
body: <p>I'm trying create a Dialog with ImageView and a Button. The ImageView I added and works but the Button I can't add in Dialog, the button doesn't display.
  How can I do it ?</p>
  
  <p>Here how I'm trying.</p>
  
  <p><strong>XML</strong></p>
  
  <pre><code>&lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"        
      &gt;
  
      &lt;ImageView
           android:id="@+id/ivCustomDialog"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"  
           android:padding="0dp"
           android:scaleType="centerCrop"                  
          /&gt;
  
      &lt;Button
          android:id="@+id/btnProsseguir"
          android:layout_width="100px"
          android:layout_height="wrap_content"
          android:background="@drawable/resp_prosseguir"
          android:layout_marginTop="5dp"
          android:layout_marginRight="5dp"
          android:layout_below="@+id/ivCustomDialog"
          /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>//activity</strong></p>
  
  <pre><code>private void showDialog(final RespostaPergunta resposta){                   
              final Dialog dialog = new Dialog(getView().getContext());
              dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
              dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
              dialog.getWindow().setFlags(LayoutParams.FLAG_FULLSCREEN, LayoutParams.FLAG_FULLSCREEN);                        
              dialog.setContentView(R.layout.custom_dialog);
              dialog.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
              ImageView ivCustomDialog = (ImageView) dialog.findViewById(R.id.ivCustomDialog);
  
              Button dialogButton = (Button) dialog.findViewById(R.id.btnProsseguir);
              dialogButton.setOnClickListener(new OnClickListener() {             
                  @Override
                  public void onClick(View v) {
                      FragmentTransaction ft;
                      Fragment frag = new InicioFrag();
                      if(resposta.getValor() == 1){
                          frag = new SalaInternaFrag();
                          ft = getFragmentManager().beginTransaction();
                          ft.replace(R.id.fl, frag);
                          ft.addToBackStack("back");
                          ft.commit();
                      }else{
                          frag = new InicioFrag();
                          ft = getFragmentManager().beginTransaction();
                          ft.replace(R.id.fl, frag);
                          ft.addToBackStack("back");
                          ft.commit();                        
                      }                       
                      dialog.dismiss();                   
                  }
              });         
  
              if(resposta.getValor() == 1){
                  ivCustomDialog.setImageResource(R.drawable.resp_correto);
              }else{
                  ivCustomDialog.setImageResource(R.drawable.resp_errado);
              }
  
              dialog.show();
  
          }
  </code></pre>