Android - ListView click HOWTO?
        Posted  
        
            by teepusink
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by teepusink
        
        
        
        Published on 2010-03-18T07:19:04Z
        Indexed on 
            2010/03/18
            7:21 UTC
        
        
        Read the original article
        Hit count: 913
        
android-sdk
|android
Hi,
How do I listen to click event on a ListView?
This is what I have now
ListView list = (ListView)findViewById(R.id.ListView01);
...
list.setAdapter(adapter);  
When I do the following
list.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
   public void onItemSelected(AdapterView parentView, View childView, int position, long id) {
                setDetail(position);
            }
            public void onNothingSelected(AdapterView parentView) {  
        }  
      });  
That doesn't seem to do anything on click.
And all those code live within a class that extends Activity.  
Thanks, Tee
© Stack Overflow or respective owner