teepusink teepusink - 1 year ago 81
Android Question

Android - ListView click HOWTO?

How do I listen to click event on a ListView?

This is what I have now

ListView list = (ListView)findViewById(R.id.ListView01);

When I do the following

list.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView parentView, View childView,
int position, long id)

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.

Answer Source

On your list view, use setOnItemClickListener