title: Android master template layout file?
body: <p>I have more than 5 activities <code>xml files</code> in <code>layout</code> folder<br>
  - <code>login_activity.xml</code><br>
  - <code>user_profile_activity.xml</code><br>
  - <code>product_activity.xml</code><br>
  - <code>buy_activity.xml</code><br>
  - <code>sell_activity.xml</code>  </p>
  
  <p>All layouts share the <strong>same</strong> <code>header</code> and <code>footer</code> views<br>
  So I create <code>header.xml</code> and  <code>footer.xml</code> then include them in each layout xml file   </p>
  
  <p>My problem<br>
  Now I need to update layout of ALL activities by adding new view in the middle<br>
  Currently solution to loop create <code>middle.xml</code> then include them in each!<br>
  As you can see, simple change added in multiple files!</p>
  
  <p>Any other solution like <a href="https://en.wikipedia.org/wiki/Web_template_system" rel="nofollow noreferrer"><code>Master Template</code></a> concept<br>
  By using it, We can make a shared master template and each layout inherit this master template, then define ONLY its layout?  </p>
  
  <p>So the final picture will be something like that  </p>
  
  <p><strong>Subviews</strong><br>
  - <code>header.xml</code><br>
  - <code>footer.xml</code><br>
  - <code>middle.xml</code>   </p>
  
  <p><strong>Template</strong>  will include <code>header</code>/<code>footer</code>/<code>middle</code> + contain <em>main empty div</em><br>
  - <code>master_template.xml</code>       </p>
  
  <p><strong>Layouts</strong>  will inherit <code>master_template.xml</code> + add impl to <em>main empty div</em><br>
  - <code>login_activity.xml</code><br>
  - <code>user_profile_activity.xml</code><br>
  - <code>product_activity.xml</code><br>
  - <code>buy_activity.xml</code><br>
  - <code>sell_activity.xml</code>   </p>