title: What context do I use for a new Dialog?
body: <p>I need a custom dialog to appear on button press. Here is my code: </p>
  
  <pre><code>Button button3 = (Button) findViewById(R.id.Button03); 
      button3.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
  
          final Dialog custdialog = new Dialog(this);
  
  
          custdialog.setContentView(R.layout.custom_drink);
  
          custdialog.setTitle("Custom Drink");
  
          custdialog.setCancelable(false);
  
   /etc.
  </code></pre>
  
  <p>However, on this line: final Dialog custdialog = new Dialog(this);</p>
  
  <p>I get an error saying "The constructor Dialog(new View.OnClickListener(){}) is undefined".</p>
  
  <p>I've tried replacing "this" with other things, but with no luck. It's odd that I get an error on this line because I have the exact same thing (except different names and stuff) in my project, beneath a switch (like this:</p>
  
  <pre><code>@Override
   public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
      case R.id.settings: 
  
   final Dialog settingsdialog = new Dialog(this);
  
      settingsdialog.setContentView(R.layout.custom_dialog);
  
      settingsdialog.setTitle("Settings");
  
      settingsdialog.setCancelable(false);
  </code></pre>
  
  <p>and that one works fine... hmmm.</p>