Result:
add a res\layout\title.xml
<merge xmlns:android="http://schemas.android.com/apk/res/android"> <!-- // the views to be merged --> <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> </merge>update relayout\main.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <!-- // some views--> <include layout="@layout/title"/> <!-- // probably more views--> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> </LinearLayout></code>
sample code:
"Tutorial_UI_LinearLayout_includeActivity"