For your reference, one way to work around this constraint of Android
ListView is to "redirect" an onClick event on a listview rwo to the
button on the row by means of calling performClick() in the onClick()
of the GetView() of the listview adapter class.

On Nov 29, 7:52 am, Stefan <[EMAIL PROTECTED]> wrote:
> I have an issue with a list view that has buttons (more precisely
> ImageButton) on each row. (The list view is similar to the one used in
> the Amazon MP3 application included in the G1 where you can see the
> song/album name and press a button with the price to purchase it.)
>
> I need to be able to perform 2 actions for each row - one when you
> click on the row and different when you click on the row's button.
>
> Adding the button itself to the row and handling the button clicks
> works fine, the problem is that for every row that has a button, you
> can't click on the row itself anymore. You can click on the row's
> button, but clicking on the rest of the row does not generate
> ItemClick event for that row in the list view.
>
> You can select the row using the navigation keys and press Enter and
> that correctly generates the ItemClick even on the row, but clicking
> on the row itself does nothing. If I hide the buttons on some of the
> rows, the row without a button clicking starts to work correctly, but
> the rows with buttons still don't work. It seems like the existence of
> a button on the row renders the row itself "unclickable".
>
> Oddly enough, if you use a RatingBar on the row instead of the Button
> you can click on both the row and the rating bar independently and
> they all work correctly as expected.
>
> Does anyone know why would the Button behave differently than the
> RatingBar and what is the correct way to make both the button and row
> be independently clickable.
>
> Stefan
--~--~---------~--~----~------------~-------~--~----~
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