Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Reusing components is one of the hallmarks of good object-oriented design, and Android supports abstracting your views to provide a similar level of componentization. By separating your UI into discrete components, you can reuse them throughout your app. This provides your app with a consistent look and makes design changes much easier to implement.
Android provides a simple method for including one layout inside another: the <include> tag. Using this tag, a different layout can be included in your view hierarchy just as if it had been written in the original XML. This makes adding reusable components to your UI a snap. Here is an example of the <include> tag:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<include layout="@layout/sub_layout" />
</LinearLayout>