I was wondering what some of the best practices of achieving this might be.
I'm looking to take a
<?xml version="1.0" encoding="utf-8"?>
You cannot do this with the
include tag, but with a
A ViewStub is an invisible, zero-sized View that can be used to lazily inflate layout resources at runtime. When a ViewStub is made visible, or when inflate() is invoked, the layout resource is inflated. The ViewStub then replaces itself in its parent with the inflated View or Views. Therefore, the ViewStub exists in the view hierarchy until setVisibility(int) or inflate() is invoked. The inflated View is added to the ViewStub's parent with the ViewStub's layout parameters. Similarly, you can define/override the inflate View's id by using the ViewStub's inflatedId property.
In your scenario you would use
setLayoutResource(int) just before you inflate the