开发者

ListView Item and OnClick problem

When you touch开发者_Python百科 some grid or listview items in an android app, he change the background color telling you that you have pressed it. I'm having a problem in my app. When I create that a listview for instance, and I press it in my phone, he change color, but if I set the OnClick property, the item dont change it color. Whats wrong? The OnClick works as its suppose.

Thanks


Generally with ListView you want to use an OnItemClickListener.

This gives you a chance to perform an action based on the position in the list that was clicked.

If you need access to the view adapter from within onItemClick then you can use AdapterView#getAdapter() on the AdapterView that is supplied to you.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜