title: ListActivity's onListItemClick does not work
body: <p>In my application with a ListActivity the overwritten <code>onListItemClick</code> callback is not fired by clicking on a <code>ListView</code> item.</p>
  
  <p>I have defined a custom listview with the followin xml Files, permissionview.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical" &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal" &gt;
  
          &lt;Button
              android:id="@+id/btn_Apply"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/btn_apply"
              android:onClick="onApplyClick" /&gt;
  
          &lt;Button
              android:id="@+id/btn_install"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/btn_install"
              android:onClick="onInstallClick" /&gt;
  
          &lt;Button
              android:id="@+id/btn_cancel"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Cancel" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;ListView android:id="@android:id/list" 
              android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:focusable="false"&gt;
  
      &lt;/ListView&gt;  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and the viewitem layout <code>checkable.xml</code> :</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  
  
     &lt;ImageView android:id="@+id/img" android:layout_width="wrap_content"
          android:layout_height="wrap_content" android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true" android:layout_alignParentBottom="true"
          android:src="@drawable/ic_launcher" android:focusable="false" /&gt;
  
      &lt;CheckBox
          android:id="@+id/check"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
         android:layout_alignParentRight="true"
          android:layout_marginLeft="4px"
      android:layout_marginRight="10px"
  
      android:clickable="true"&gt;
  
   &lt;/CheckBox&gt;
  
      &lt;TextView
          android:id="@+id/label"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerVertical="true"
          android:layout_toRightOf="@+id/img"
          android:gravity="bottom"
          android:text="@+id/label"
          android:textSize="15px"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The defined <code>ArrayAdapter</code> is defined as following:</p>
  
  <pre><code>     public class InteractiveArrayAdapter extends ArrayAdapter&lt;Model&gt; {
  
  
      private final List&lt;Model&gt; list;
      private final Activity context;
      private boolean changeable;
  
      public InteractiveArrayAdapter(Activity context, List&lt;Model&gt; list, boolean changeable) {
          super(context, R.layout.checkable, list);
          this.context = context;
          this.list = list;
          this.changeable = changeable;
      }
  
      static class ViewHolder {
          protected TextView text;
          protected CheckBox checkbox;
          protected ImageView image;
          protected int pos;
      }
  
      public View getView(int position, View convertView, ViewGroup parent) {
          View view = null;
          if (convertView == null) {
              LayoutInflater inflater = context.getLayoutInflater();
                  view = inflater.inflate(R.layout.checkable, null);
  
  
              final ViewHolder viewHolder = new ViewHolder();
              viewHolder.text = (TextView) view.findViewById(R.id.label);
              viewHolder.checkbox = (CheckBox) view.findViewById(R.id.check);
              viewHolder.image = (ImageView) view.findViewById(R.id.img);
              viewHolder.pos = position;
  
  
              view.setClickable(true);
  
              if (!changeable)viewHolder.checkbox.setEnabled(false);
  
  
              viewHolder.checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
  
  
  
                  public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                      Model element = (Model) viewHolder.checkbox.getTag();
  
                      element.setActive(buttonView.isChecked());
                  }
  
              }
              );
  
  
  
              view.setTag(viewHolder);
              viewHolder.checkbox.setTag(list.get(position));
  
          } else {
              view = convertView;
              ((ViewHolder) view.getTag()).checkbox.setTag(list.get(position));
  
          }
          ViewHolder holder = (ViewHolder) view.getTag();
          holder.text.setText(list.get(position).showPermission());
          holder.checkbox.setChecked(list.get(position).isActive());
  
          if (list.get(position).isRedundant()) {
              holder.image.setImageDrawable(context.getResources().getDrawable(R.drawable.warning));
          } else {
              holder.image.setImageDrawable(context.getResources().getDrawable(R.drawable.ok));
          }
          return view;
  
      }
  
  }
  </code></pre>
  
  <p>In the class extending ListActivity a defined ArrayAdapter is filled with an arrayList in an asyncTask (list informations are calculated in <code>doInBackground()</code> method):</p>
  
  <pre><code>public class PermissionViewActivity extends ListActivity {
  
      private final static String TAG = "PMA";
      ...
       @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.permissionview);
          ...
      }
  
      ... 
  
       private class CurrentPermissions extends AsyncTask&lt;String, Integer, String&gt; {
  
          private ListActivity la;
          private Context context;
  
  
  
          private int progress = 0;
  
          public CurrentPermissions(ListActivity la) {
              this.la = la;
              this.context = la;
  
          }
  
          protected void onPreExecute() {
          ...
  
          protected void onPostExecute(String result) {
            adapter = new InteractiveArrayAdapter(la, permissionList, changeable);
            la.setListAdapter(adapter);
            /output with number of listitems
                System.out.println("DEBUG1 " + la.getListAdapter().getCount());
          }
       }
        ...
        @Override
        protected void onListItemClick(ListView l,  View view, int position, long id) {
          super.onListItemClick(l, view, position, id);
          System.out.println("clicked !");
        }
        ...
      }
  </code></pre>
  
  <p>The <code>onListItemClick</code> method is not executed. When defining the onClickListener in the ArrayAdapter the click event works:</p>
  
  <pre><code> view.setOnClickListener(new OnClickListener() {
                  public void onClick(View v) {
  
                      System.out.println("Klick D1 " + list.get(viewHolder.pos));
  
                  }
  
              });
  </code></pre>
  
  <p>Why does the definition of the click-event in the ArrayAdapter work, but overwriting in the ListActivity not ? I cant find the failure.</p>