In the previous installment of Android Layout Tricks, I showed you how to use the
tag in XML layout to reuse and share your layout code. I also mentioned the
and it's now time to learn how to use it.
The
was created for the purpose of optimizing Android layouts by reducing the number of levels in view trees. It's easier to understand the problem this tag solves by looking at an example. The following XML layout declares a layout that shows an image with its title on top of it.
Source: Android Developers Blog