How to inflate one view with an layout

Posted by Michal Dymel on Stack Overflow See other posts from Stack Overflow or by Michal Dymel
Published on 2010-02-25T16:47:51Z Indexed on 2010/06/01 23:03 UTC
Read the original article Hit count: 193

Filed under:

Hi,

I have a layout defined in XML. It contains also:

<RelativeLayout
    android:id="@+id/item"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
/>

I would like to inflate this RelativeView with other XML layout file. I may use different layouts depending on a situation. How should I do it? I was trying different variations of

RelativeLayout item = (RelativeLayout) findViewById(R.id.item);
item.inflate(...)

But none of them worked fine. Heeelp ;)

© Stack Overflow or respective owner

Related posts about android