I\'m building a complex layout and I want to use include
tag for my custom component, like this:
I know this is an old question but I came across it and found that it is now possible thanks to Data Binding.
First you need to enable Data Binding in your project.
Then add data binding to the layout you want to include:
...
...
Finally, pass the variable from the main layout to the included layout like this:
...
...
xmlns:app="http://schemas.android.com/apk/res-auto"
...
...