views:

87

answers:

1

Hey guys,

I've got a class that creates a list from a DB using SimpleCursorAdapter. I want to add an onClick event to each item in the list but I don't know where to place the code.

Any help?

A: 

You would override the onListItemClick mehtod.

@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
    Uri uri = ContentUris.withAppendedId(this.getIntent().getData(), id);
    // your code
}
Dan