How to include other layout xml files in a layout file in Android

Sometimes some layout files can contain too many views making it difficult to manage the layout file later. To overcome this, Android has an <include> tag that allows the inclusion of other layout files into the main layout file (in below illustration, the activity_main.xml file).

<include android:id="@+id/b_layout" layout="@layout/activity_main_part_b" />

The above include statement will add the contents of the layout file activity_main_part_b into the activity_main.xml file.