Android for multiple modules if you want the UI logic of the speech in addition to fragment, there is nothing else to support,
Include,merge,viewstub can only support a common UI, but this generic support cannot contain logic (Java code).
1. Using the Include tag
This tag only initiates the function of repeating a UI XML file, the Android framework does not have any optimizations when parsing, and the only function is to facilitate the management of the role.
When parsing to the include tag, take out the layout file from its Layouts property, parse the layout, and replace the node with the include tag
2. Using the Merge tab
The merge tag, which handles the same features as the include tag (reusing the UI XML file), is a little bit more of an optimization feature,
When parsing to <merge> tags, if a tag below the merge (first layer) is the same as the parent tag, then the child element underneath the tag is added to the parent tag of the merge.
3. Using the Viewstub label
One of the main functions of viewstub is that the framework does not parse the viewstub layout file when it is not visible, a little bit of optimization.
4. Using the Relativelayout label
With this viewgroup you can usually reduce the number of nesting.
Common tips for Android layout optimization