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. starting an activity from an app widget...

if I start an activity which is already up from within my application,
I get:

    MyActivity.onRestart()
    MyActivity.onStart()
    MyActivity.onResume()

If I start the activity from within my application widget, I get:

    MyActivity.onCreate()
    MyActivity.onStart()
    MyActivity.onResume()

Even though I start both activities with the same intent:

    Intent intent = new Intent(this, MyActivity.class).
                           setAction("MyAction");
    intent.addFlags( Intent.FLAG_ACTIVITY_REORDER_TO_FRONT  );

Why would it be creating a new activity?

tia.

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

2. Oot : Menu baru

Maap numpang narsis dan oot

@s2 semarang

Ids

www.indraracing.com
--~--~---------~--~----~------------~-------~--~----~
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group, please visit the following page:
 

3. onCreate() and current tab

4. Inconsistency on the definition of the sign of X acceleration?

5. Eh...Boss. Caranya nyimpen SMS gimana?

6. wt-sale :HTC Magic A 6161 second garansi sistec

7. how to expand screen number?