It's not random at all. findViewById() is a depth-first search
algorithm; it will return the first view of the specified id it can
find.

On Wed, Aug 5, 2009 at 9:24 AM, Mark Murphy<[email protected]> wrote:
>
> Tom wrote:
>> Can someone tell me what would be the outcome of using findViewById
>> when multiple child views have the same ID lets say for example when
>> using a layout to dynamically produce multiples of the same control?
>
> Random chance as to which one you will get.
>
> If you need one for a specific, say, row, call findViewById() on the row
> View to find that View's child with the common name.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://twitter.com/commonsguy
>
> Android Development Wiki: http://wiki.andmob.org
>
> >
>



-- 
Romain Guy
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~
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