On Mon, Sep 27, 2010 at 9:44 AM, Martin <[email protected]> wrote:
> How can I add a layout to another layout in java?
> In xml, you can do it with include.
> How can you do it in java without the help of xml?
> (I need to know this because the number if includes changes
> dynamically).

getLayoutInflater().inflate(R.layout.theonetoinclude, theparentlayout, true);

where:

-- R.layout.theonetoinclude is the XML layout file to include
-- theparentlayout is the existing ViewGroup into which you want to
append the inflated layout as a child

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://skillsmatter.com/go/os-mobile-server

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