Hi
 I have the same problem , at last i do it like this
I write two GestureListener, implement onSingleTapUp method.
set both the button and other view's clickable to false
and set them OnTouchListener(NOT onClickListener) with GestureListener.
if you haven't used GestureListener, you can learn it from ApiDemos.
On Mon, 15 Mar 2010 16:26:32 +0800, Anton Pirker <[email protected]> wrote:

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


---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------

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

Reply via email to