title: inflating views android
body: <p>I have this main.xml layout which has a fixed header and footer. The body content has to change based on the parameters received.</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="fill_parent"
      android:layout_height="fill_parent" android:background="#FFFFFF"
      android:id="@+id/main_view"&gt;
      &lt;com.HeaderView
          android:id="@+id/HeaderView"
           android:layout_alignParentTop="true"
          android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt;
      &lt;com.FooterView
          android:id="@+id/FooterView"
          android:layout_alignParentBottom="true" android:layout_width="match_parent"
          android:layout_height="wrap_content" /&gt;
  
      &lt;RelativeLayout android:layout_width="fill_parent"
          android:layout_height="wrap_content" android:id="@+id/BodyView"
          android:layout_below="@id/HeaderView"
          android:layout_above="@id/FooterView"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Based on the below conditions I need to load the BodyView in the main.xml.</p>
  
  <pre><code>If parameter == Apple 
    then load layout AppleView in the BodyView
  if parameter == Bat
    then load layout BatView in the BodyView
  </code></pre>
  
  <p>I have AppleView and BatView xml layout defined. Could somebody please guide me as to how I can load either of the views and set/get values into/from it.</p>