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()
精彩评论