1

I have a listview with custom listitem. I have bunch of textviews in Relative layout. And when I click on listitem it goes to different screen. Now I have added 3 buttons and toggle button to list item and I CAN NOT CLICK THE LIST ITEM. What am I missing :(

2 Answers 2

4

set focusable property of all the buttons to false and so that you can click on list and also touch event for all buttons will work

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

Comments

0

When the user clicks the row, the ListView will look for a widget implementing the Checkable interface. The RelativeLayout does not. An easy way to do that is simply to create your own CheckableRelativeLayout class. See http://www.marvinlabs.com/2010/10/custom-listview-ability-check-items/ for a full tutorial with code.

Also, the buttons and other items in your row layout should not be focusable. You can see other SO questions: Android Row becomes Unclickable with Button

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.