O god, ViewStub is declared final. Why??????????????????? I can't extend it. How do I reuse it?
On Jul 13, 7:14 pm, Tapomay Dey <[email protected]> wrote: > Thanks for the ViewStub approach. > > On Jul 13, 6:08 pm, Kostya Vasilyev <[email protected]> wrote: > > > Yeah, why not? > > > Presumably, you have some logic in the code that knows the type of UI > > it's building. > > > Add a ViewGroup to your layout with a known id, and have the code > > inflate the actual layout, then add it to the view group. > > > Another option is to use ViewStubs in the parent layout, and call > > inflate / show on just the needed stub. This will let you specify the > > actual layout in the XML. Once a ViewStub is inflated / shown, it > > removes itself from the view hierarchy, replacing itself with the > > inflated layout. > > > -- Kostya > > > 13.07.2011 16:42, Tapomay Dey пишет: > > > > Following could be a solution: > > > In the setter method for layout resourceID, inflate the layout and add > > > it as child to the "this" View object. > > > Is this a clean approach? > > > > Regards, > > > Tapomay. > > > -- > > Kostya Vasilyev -- 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

