Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android - add one xml layout in other xml layout

Tags:

android

I have two XML layouts declared in the res/layout folder one contains the generic template and the other contains the views specific to a particular screen. I want to add the second xml layout to the first one i.e. the generic one. As both of these layouts are declared as XML, I am not able to add one to other. How do I solve this problem?

like image 220
Robin Avatar asked Nov 28 '22 04:11

Robin


1 Answers

I may not be understanding it correctly. But it might be a lot easier to use the <include layout="@layout/yourlayouthere" /> method to simply embed using just XML notation. I use this method to build a bunch of little parts and then pull them together in my main layout using the inlcude statement.

like image 156
Michael Avatar answered Dec 19 '22 11:12

Michael