Hi Sunit,

To get the position/index of the item on which its button is clicked
is not hard. It is just equal to the final "position" parameter passed
to getView(). So placing the parameter in onClicked callback of the
button gets it done.

On Nov 11, 8:16 am, "Sunit Katkar" <[EMAIL PROTECTED]> wrote:
> Add some id or attribute to your Button which has the information about the
> List item - say the position or index of the list item. So when a button
> click is received, you not only get the button clicked but also the position
> in the list.
> Maybe this will help. I am not sure if Android allows event bubbling and
> capture like in Javascript.
>
> - Sunit
>
>
>
> On Mon, Nov 10, 2008 at 5:24 PM, Nickname <[EMAIL PROTECTED]> wrote:
>
> > Hi, Romain and Sunit.
>
> > Thanks for replies from you both.
>
> > My app needs to get both callbacks from the Button as well as from
> > "the other area" of a ListView item.
>
> > Right now, I use a onClick listener to the LinearLayout of every
> > ListView item. It works so far :-)
>
> > On Nov 10, 8:34 am, Romain Guy <[EMAIL PROTECTED]> wrote:
> > > If you put a focusable View inside a list item, then the list item
> > > will not be clickable. You would have to set a click listener on the
> > > button for instance.
>
> > > On Sun, Nov 9, 2008 at 10:18 PM, Nickname <[EMAIL PROTECTED]> wrote:
>
> > > > One of my ListView's has a Button view on every item's LinearLayout.
>
> > > > I just found that clicking on any item of the ListView does not
> > > > callback its onItemClick(), which is set thru
> > > > ListView.setOnItemClickListener().
>
> > > > If I remove the Button view from item layout, callback is ok then.
>
> > > > Can anybody advise me how I get the callback on the ListView with
> > > > Button?
>
> > > > Thanks.
>
> > > --
> > > Romain Guywww.curious-creature.org
>
> --
> - Sunit Katkarhttp://sunitkatkar.blogspot.com/- Android OS Tutorials
--~--~---------~--~----~------------~-------~--~----~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to