title: Propagate button onclick of custom arrayadapter in my activity
body: <p>My activity has a ListView that has a custom ArrayAdapter.
  On my ArrayAdapter i have an image, a bunch of textboxes and a button.</p>
  
  <p>On the getView of the adapter i get my button and set setOnClickListener. From the click listener i can get the index of the clicked item.</p>
  
  <p>Now my problem is that i want to propagate that information to my main activity, where i want to handle my button click.
  I can save the index information in a static var, but i still don't know how to fire an event in my activity.</p>
  
  <p>How do i do that?</p>
  
  <p>I'm 6 days new to Android so, thanks
  iggy</p>
  
  <p>Code:</p>
  
  <p>My Activity:</p>
  
  <pre><code>public class MyClass extends Activity{
  ...
      public void onCreate(Bundle savedInstanceState) {
      ...
      myListView = (ListView)findViewById(R.id.lvxml);
      myList = new MyCustomArrayAdapter(this, myAnotherClassObject);
      myListView .setAdapter(myList);
      ...
      }
  }
  </code></pre>
  
  <p>Now in my Adapter</p>
  
  <pre><code>public class MyCustomArrayAdapter extends ArrayAdapter&lt;myAnotherClass&gt; {
  ...
  ....
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
           Button b = (Button)convertView.findViewById(R.id.myButtonInListView);
           b.setOnClickListener(new View.OnClickListener() {
               public void onClick(View v) {
                   doStuff;
               }
       });
      }
  }
  </code></pre>
  
  <p>I need to somehow fire a buttonclick from my main activity, but without loosing the possibility to read the index clicked in the list view.</p>