简体   繁体   中英

onClick inside ListActivity using SimpleCursorAdapter

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?

You would override the onListItemClick method.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM