开发者

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 plac开发者_如何学Ce 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
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜