开发者

One ListView. Two objects inside. Two different tasks. How to?

I have the following problem. In my app I have one ListView and both picture and text inside. | [pic] __ text _ | I need to do two different tasks where position is significant e.g. if I click on pic toast shows "Hi Im pic & my position in the ListView is 3", whereas if I click on text toast shows "Hi Im text & my position in the Listview is 3". There is no problem if there is one item in the ListView as I can invoke onListItemClick, or there is also no problem if position开发者_开发问答 is not important - I can add onClick in XML and implement listener with View parameter. However there is a problem if I need to know in both cases what was the position of clicked item.

Would be grateful for any responses.


Have two listener , one for imageview and one for textview, Get children of Listitem(imageview and textview) , and attach separate listener to them.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜