-1

I have custom listview with textview and button. I set the button click handle in the xml 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

1

1 Answer 1

7

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()

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.