You can inflate as many child layouts as you want, you just have to be careful on how you do findViewById .. if you do it on the root, you would not be able to find all of them. Thats like making 10 children named John and be surprised that when you call their name all of them turn around. But if you keep them in separate rooms and then call them from each door, you could find them all. The same behavior happens on ListViews and pretty much any repetitive layout...
Regarding it working without an ID - Easy, the system generates one if there isn't one.. but uses the one you defined if you did. The samples are just samples - They intend to show you how to do some specific stuff, like using the animation framework... they're not meant to be all encompassing and solve all the world issues... that's your job. 99% of the code i wrote is "original" in a sense it does not resemble any single sample\tutorial, but i did know how to get to that 99% from the samples\tutorials. On Monday, May 13, 2013 5:30:10 AM UTC+3, Y2i wrote: > > If we inflate from the same layout, all child elements within that layout > will have the same ids by definition. If framework does not allow adding > children inflated from the same file to a LinearLayout I would consider it > as a not very good framework :( Even if the framework does its own > caching under the hood and applies the saved state to the view that is > CREATED FROM SCRATCH after the orientation change, how can we explain that > everything works and the values are applied properly when we remove ID > attribute? How would the framework find where to assign the correct values > to? It does not make sense. > > Anyway, I'll move back ListView/Adapter and figure out how to do the > animation myself. The animation sample given at the training > section<http://developer.android.com/training/animation/layout.html>is half > baked, it does not preserve the state on rotation. If we modify > the sample then it will work as expected. But the reason it works as > expected is because views use @android:id/text1, which is a pre-defined ID. > But if we replace that ID with @+id/text1, even the sample from the > training section stops working. There is too much flaky stuff there from > my perspective. > > Thanks everyone a lot for your time! > > Yuri > -- -- 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 --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

