title: Android : "The constructor AlertDialog.Builder(new View.OnClickListener(){}) is undefined" error
body: <p>I found the code for building some inputboxes and they are alright, but in this code it just doesnt work:</p>
  
  <pre><code>View.OnClickListener handleOnClick(final TextView textview) {
      return new View.OnClickListener() {
          public void onClick(View v) {
  
              if(editOn==1){
                  textview.setText("neuer Text");
  
                  AlertDialog.Builder alert = new AlertDialog.Builder(this);
  
                  alert.setTitle("Hinzufügen");
                  alert.setMessage("Name des neuen Eintrags");
  
                  final EditText input = new EditText(this);
                  alert.setView(input);
  
                  alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int whichButton) {
                    String entryInput = input.getText().toString();
                    loadUp(entryInput,"0","1.1.2000");
                    }
                  });
  
                  alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                    }
                  });
  
  
              }
          }
      };
  }
  </code></pre>
  
  <p>It says, that "The constructor AlertDialog.Builder(new View.OnClickListener(){}) is undefined"
  Whenever i try to insert something in ".. new AlertDialog.Builder(<strong>this</strong>); , then i dont have any errors. I know, that "this" has to refer to something. When i used this code snippet on a menuitem, it works well, but i want to use it whenever i activated my edit button (thats what if(editOn==1) means) and click on a textview. This is kind of confusing i think, but i hope someone out there understand what i need and may help me !</p>