开发者

android Custom ListView selected row on button click

I have custom listview with textview and button. I set the button click handle in the xml开发者_StackOverflow files and the implementation in the ListActivity.

The problem is when i click the button, I cant get which selected row that i click.

Regards


Are you using your own adapter? If so, you could certainly set a tag on the button, indicating it's position in the list.

something like

@Override
getView(... position ...){
//do stuff
  buttonView.setTag(new Integer(position));
//do stuff
}

Then later you can get check the view.getTag() onClick()

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜