title: How to handle ListView click in Android
body: <p>How do I listen to click event on a ListView?</p>
  
  <p>This is what I have now</p>
  
  <pre><code>ListView list = (ListView)findViewById(R.id.ListView01);  
  ...  
  list.setAdapter(adapter);  
  </code></pre>
  
  <p>When I do the following  </p>
  
  <pre><code>list.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {  
     public void onItemSelected(AdapterView parentView, View childView, 
                                                           int position, long id) 
     {  
         setDetail(position);  
     }
  
     public void onNothingSelected(AdapterView parentView) {  
  
     }  
  });  
  </code></pre>
  
  <p>That doesn't seem to do anything on click.<br>
  And all those code live within a class that extends Activity.  </p>