Hello List!

I have a problem that some other people on this list (and other android sites) also have/had, but was unable to find a solution.
I have a ListView with a custom view for the row which looks like this:

<RelativeLayout>
   <ToggleButton/>
   <TextView/>
</RelativeLayout>

Its basically a list of songs that i show. What i want to achieve:

If the user clicks on the ToggleButton the song should be played.
If the user clicks somewhere else on the row, the details intent of the song should be launched.

So I want to have two events on every row, event1: the button click, event2: click somewhere except on the button.

Right now i have a custom adapter where i call .setOnClickListener() on the button. Now the button works (event1 works), the song is played, but the rest of the row is not clickable (event2 does not work). If i remove the call to setOnClickListener() the row is clickable (event1 works) and the details are displayed as suppossed, but the button is not working. (event1 does not work)

There are apps out there, that have buttons in lists so this must be possible. Could someone please tell me how to have more than one click event on a lists row?

I have found a solution that reads: "You have to use TouchDelegate" But i do not have a clue how! If someone knows how a solution with TouchDelegate looks like, please explain it to me!

Thanks,
Anton

--
DI(FH) Anton Pirker

------------------------------
cross platform mobile software
burggasse 123/53
a-1070 wien
tel: +43 699 1234 0 456
skype: antonpirker

http://anton-pirker.at



--
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to