title: Custom ArrayAdapter, listView, button
body: <p>I try to capture the click of the button in MainActivity but this didn't work with me.
  How to do it.
  I put toast in my getView it seems to work, but how to catch the click in MainActivity.</p>
  
  <pre><code>@Override
  public View getView(final int position, View convertView, ViewGroup parent){
  
  
      LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
  
  
      rowView = inflater.inflate(R.layout.gestionmaps, parent, false);
  
  
      textView   = (TextView) rowView.findViewById(R.id.textView02);
      btn2       = (Button) rowView.findViewById(R.id.spinner02);
      btn        = (Button) rowView.findViewById(R.id.del02);
  
      textView.setText(values.get(position));
  
      btn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
  
  
  
              Toast.makeText(context, "btn "+position, Toast.LENGTH_SHORT).show();
  
          }
      });
  
      btn2.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
              Toast.makeText(context, "btn0 "+position, Toast.LENGTH_SHORT).show();
  
          }
      });
  
  return rowView;
  
  }
  </code></pre>