title: Make alert dialog in BaseAdapter extended class
body: <p>I have a MyListAdapter Java class that it like below:</p>
  
  <pre><code>class MyListAdapter extends BaseAdapter implements TextToSpeech.OnInitListener{
  </code></pre>
  
  <p>now I want to make a confirmation dialogue on each list items like below:</p>
  
  <pre><code>btnDelete.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
  
  
  
              AlertDialog.Builder alert = new AlertDialog.Builder(this);
              alert.setTitle("Delete");
              alert.setMessage("Are you sure?");
              alert.setPositiveButton(android.R.string.yes,
              new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int which) {
                              // continue with delete
                  new DatabaseHelper(context).deleteEmployee(employees.get(position));
                  employees.remove(position);
                  notifyDataSetChanged();
                          }
                      });
  </code></pre>
  
  <p>But on</p>
  
  <pre><code>AlertDialog.Builder alert = new AlertDialog.Builder(this);
  </code></pre>
  
  <p>I have an error that it say:</p>
  
  <pre><code>builder (android.content.Context)    in Builder cannot be applied to (anonymous android.view.View.OnClickListner)
  </code></pre>
  
  <p>I don't have any problem when my class extends from AppCompatActivity</p>