ListView touch mode click on child views

by Xavier » Sat, 16 Jan 2010 02:07:16 GMT


Sponsored Links
 Hello,

This is driving me nuts. I have a ListView that uses an extended
ArrayAdapter<T>. Each row "cell.xml" contains a RelativeLayout and
within a few TextViews and ImageViews.

I have declared in the list xml definition a selector to change the
row background:

<item name="android:listSelector">@drawable/list_selector_background</
item>

It works. But only if the click (touch mode) not done over any of the
elements contained in the RelativeLayout. Any click outside this
elements will (correctly) trigger the selector. I have tried using
android:focusable="false" on each child view without avail.

What do I need to do to be able to trigger the selector, no matter
where the user clicks?

Thanks!



ListView touch mode click on child views

by Zsolt Vasvari » Sat, 16 Jan 2010 09:07:06 GMT


 Have you tried setting focusable="true" on the entire View the makes
up the list item?



> Thanks!


Sponsored Links


Other Threads

1. Unparsed aapt errors (Check the console)

Hi All,

            I am getting error in eclipse, as  "Unparsed aapt errors
(Check the console)", whenever, i am adding new xml in layout folder.

Thanks,

Dhuri Natarajan.

--~--~---------~--~----~------------~-------~--~----~

2. CommunicationHistory ContentProvider vs. SortCursor

I was originally going to submit this post on the need for a
SortCursor, which would take in an array of Cursors and a Comparator
and treat the list of cursors as a single sorted list.  Then I thought
about the real issue I'm having is the fact that there is not a common
CommunicationHistory provider.  Essentially, the problem is that there
are two history tables, one for phone calls, and one for sms, and
there could potentially be many more depending on number of
applications retaining communication history.  I think that the there
should be a ContentProvider for CommunicationsHistory in order to
consolidate the history to make it easier to sort/display as a single
list.  I just wanted to see what other people's thoughts are before I
start on this endeavor or whether something like this would be
accepted into the framework were I to submit it as a patch.
--~--~---------~--~----~------------~-------~--~----~

3. What kind of device should Linux udev set up for G1 linked via USB

4. sensors HAL/single input device for multiple kernel drivers

5. Theme.Dialog for PreferenceScreen child does not work

6. adb stopped working (Ubuntu 8.10)

7. JMI and android