title: Trying to create a custom dialog
body: <p>I'm trying to create a custom dialog.  I'm getting 2 compile errors, and don't really understand why.</p>
  
  <ol>
  <li>The Method SetOnClickListner in the type view is not applicable for the arguments new OnClikLiatner
  code : </li>
  <li>The methed on click view in type new OnClickListener must override supertype</li>
  </ol>
  
  <p>Code giving the errors:</p>
  
  <pre><code>dialogButton.setOnClickListener(new OnClickListener() { // error message 1 here
                          @Override
                          public void onClick(View v) { // error message 2 here
                              dialog.dismiss();
                          }
                      });
  </code></pre>
  
  <p>All the code</p>
  
  <pre><code> void StartGame()
         {
          // custom dialog
                      final Dialog dialog = new Dialog( cGlobals.MainHome );
                      dialog.setContentView(R.layout.activity_start_play);
                      dialog.setTitle("Title...");
  
                      // set the custom dialog components - text, image and button
                      TextView text = (TextView) dialog.findViewById(R.id.text);
                      text.setText("Android custom dialog example!");
              //      ImageView image = (ImageView) dialog.findViewById(R.id.image);
              //      image.setImageResource(R.drawable.ic_launcher);
  
                      Button dialogButton = (Button) dialog.findViewById(R.id.dialogButtonOK);
                      // if button is clicked, close the custom dialog
                      dialogButton.setOnClickListener(new OnClickListener() {
                          @Override
                          public void onClick(View v) {
                              dialog.dismiss();
                          }
                      });
  
                      dialog.show();
  
  
         }
  }
  </code></pre>