title: Buttons in ListView inside array adapter & fragment - Android
body: <p>I have an application that I am creating, in which there is a <code>Fragment</code> that contains a list view, this <code>ListView</code> is hosted in the main activity. </p>
  
  <p>Each item in the list contains 10-20 buttons. How to have a click listener attached to them and perform actions when click, IE updating information on the screen? </p>
  
  <p>EDIT: more information</p>
  
  <p>Inside of listFragment:</p>
  
  <pre><code>public void myButtonHandler(View view){
  //Handles method actions
  }
  </code></pre>
  
  <p>inside of main activity:  </p>
  
  <pre><code>public void myButtonHandler(View v){listFragment.myButtonHandler(v);
  
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>05-09 11:15:27.900    7122-7122/project.rapid.proto E/AndroidRuntime﹕ FATAL EXCEPTION: main
  Process: project.rapid.proto, PID: 7122
  java.lang.IllegalStateException: Could not find a method myButtonHandler(View) in the activity class android.app.Application for onClick handler on view class android.widget.ImageButton with id 'required2'
  </code></pre>
  
  <p>The button clicks perform operations on information contained inside the fragments, thats why i attempted the call through.</p>