title: Android Fragment's onClickListener not called
body: <p>I have a fragement that has a header with two buttons and a list on it. I want to get events on those items. The fragment is dynamically added to the UI, and my app is for android 16 and upwards, so I don't have to use the support lib. 
  I decided to implement the click listeners to the both the buttons and the list on the MainActivity since these fire off database look ups, and I would like to keep my db lookups in one place. so, I made a main activity that implements both: OnClickListener and OnItemClickListener and added the following methods:</p>
  
  <pre><code>public void onClick(View v) {
  Toast.makeText(getApplicationContext(), "List Click", Toast.LENGTH_SHORT).show();
  }
  @Override
  public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {
  Toast.makeText(getApplicationContext(), "List Click"+arg2, Toast.LENGTH_SHORT).show();
  }
  </code></pre>
  
  <p>To call the fragment I do:</p>
  
  <pre><code>//get a list of the data
  Fragment sideFormations=sideFragment.newInstance(list);
  sideFormations.setClickListeners(this,this); //&lt;--important bit
  Toast.makeText(getApplicationContext(), "listeners set", Toast.LENGTH_SHORT).show();
  FragmentTransaction ft = getFragmentManager().beginTransaction();
  ft.replace(R.id.side_frame,sideFormations);
  ft.commit();
  </code></pre>
  
  <p>In the frag's setClickListener's method, I set save the values passed in as click listeners.and the relevant sections of the frag are: </p>
  
  <pre><code>onCreateView: //nflate the views, setAdapter for the list, ensure clickability of the views
  onStart: //assign click listeners which were passed in to the list, and to the header. 
  </code></pre>
  
  <p>I still can't catch clicks in the main activity ie. zero but no errors. Any ideas will be highly welcome, and appreciated. Thank you. </p>
  
  <p>EDIT: Adding code where I define the listeners for the views.</p>
  
  <pre><code>//This is the latest iteration. As I mentioned, I have tried to set these at different places in the frag's lifecycle without much success:
  public void onStart() {
      super.onStart();
      listView.setOnItemClickListener(new OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,long arg3) {
              System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!");
              Log.d("CLICK-VIEW","List Clicked");
              main.onItemClick(arg0,arg1,arg2,arg3);
          }               
      });
      mHeaderView.setOnClickListener(new OnClickListener() {          
          @Override
          public void onClick(View v) {
              System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!");
              Log.d("CLICK-VIEW","Header Clicked");
              //main.onClick(v);
          }
      });
  }
  </code></pre>