tags:

views:

12

answers:

1

I have a layout I want to reuse, it looks like:

<LinearLayout .. >
  <Button />
</LinearLayout>

It is in a file called "reuseme.xml". Now I have an activity layout, which like the following, how can I incorporate the layout above into it?:

<LinearLayout>
  <TextView />
  <TextView />
  <ReuseMeLayout /> // How do we add this here?
</LinearLayout>

It seems that's possible, but I'm not sure how to use the merge tag to accomplish it?

+2  A: 
<LinearLayout>
  <TextView />
  <TextView />
  <include
    android:id="@+id/reuseme"
    layout="@layout/reuseme"/>
</LinearLayout>
Cristian