Android: Inflating multiple .XML and objects onto one single .XML-Collection of common programming errors

Object: (Running API 8) Programmatically, I am trying to inflate the following onto a single layout, main.xml

  • bg_content1.xml
  • bg_content2.xml
  • @+id/img_logo
  • @+id/str_username

Note:

  1. @+id/img_logo is an id of an ImageView located in bg_content3.xml
  2. @+id/str_username is an id of a TextView located in bg_content4.xml
  3. Please don’t ask me why I have to inflate multiple layouts and objects onto the other layout. I am trying to optimize my layouts for maintainability purposes.

main.xml



bg_content1.xml