title: CardView has lost margin when inflating
body: <p>In my activity, I am setting the layout activity_main onCreate.   I am then wanting to inflate my CardView for each of the items in my array.</p>
  
  <p>So far, I've got everything loaded, however my CardView's have lost their margin.  When added to the layout through XML, the margin works, but when its inflated as a separate XML file the margin is lost.</p>
  
  <p>I am inflating the activity_main_card like so:</p>
  
  <pre><code>LinearLayout item = (LinearLayout)findViewById(R.id.card_holder);
  View child = getLayoutInflater().inflate(R.layout.activity_main_card, null);
  item.addView(child);
  </code></pre>
  
  <p>In the activity_main_card, my XML is as follows:</p>
  
  <pre><code>&lt;android.support.v7.widget.CardView
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:card_view="http://schemas.android.com/apk/res-auto"
      android:id="@+id/card_view"
      android:layout_gravity="center"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      card_view:cardCornerRadius="2dp"
      android:layout_marginBottom="16dp"&gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal"&gt;
  
          &lt;ImageView
              android:layout_width="100dp"
              android:layout_height="100dp"
              android:scaleType="fitCenter"
              android:background="@drawable/cin"/&gt;
  
          &lt;LinearLayout
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               android:orientation="vertical"
               android:padding="16dp"&gt;
  
               &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:textSize="20sp"
                  android:textStyle="bold"
                  android:textColor="@color/dark_grey"/&gt;
  
               &lt;TextView
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
                   android:textSize="12sp"
                   android:textStyle="normal"
                   android:textColor="@color/grey_500"/&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>Can anyone point me in the direction where I am going wrong?</p>