If you're going to inflate all the stubs within one lifecycle of your
activity, then there is almost no benefit to using them, since all of their
respective view hierarchies will end up in memory.

If you really wanted to go down this route, you could remove the unneeded
parts of the hierarchy from their parents and replace them with view stubs
again, from code (is there a public constructor for ViewStub? you could look
it up).

This would allow unreferenced views to be GC'd, but unless your layouts are
really complex, is probably not worth it.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com
08.01.2011 17:34 пользователь "Pedro Duque" <[email protected]> написал:
> I'm trying to gasp viewstubs but I feel I'm missing something.
>
> As I understand, a viewstub only exists in a hierarchy until inflated
> or until made visible. After that is replaced by its referenced
> layout. This behaviour makes impossible to reinflate a inflated
> viewstub. Is this correct?
>
> The behaviour I was looking for was to have several buttons that would
> open diferente viewstubs. When I click a button it would deflate the
> previous layout and inflate the new one but this only works the first
> time... After that the viewstub is gone...
>
> --
> 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]<android-developers%[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 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