Saturday, July 10, 2010

[android-developers] ListView containing multiple, clickable, Views (i.e. like GMail)

Hi

I've been wrestling with trying to achieve something similar to the
GMail app's ListView entries (i.e. clicking/tapping on the whole entry
will start a new Activity (in GMail's case the email proper), and
there's a Button (of sorts) on the right side of the entry that should
call back to the registered onClickListener.

This is the (editted) structure of my ListView entry:

<LinearLayout android:orientation="horizontal">
<RelativeLayout>
<Various TextViews>
</RelativeLayout>

<ImageButton/>

</LinerLayout>

I can click/tap the ListView entry (and it starts an Activity as
required) *if the ImageButton isn't there*. Adding the ImageButton,
however, a) stops me from being able to tap the ListView entry to
start an Activity, and b) results in the ImageButton not generating a
onClick() callback (even though it appears to register OK).

Clearly, there's an issue with how the ListView handles the various
Views within it, and ends up not responding to any clicks/taps (I can
highlight the ListView entries with the trackball, however), but I've
no idea what it could be.

Are there any pointers someone could give me? Any help would be much
appreciated.

Cheers

James

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate