title: CardView disappearing on API 19
body: <p>I have developed an app that works perfectly on Lollipop. However, I am experiencing some strange glitches on kitkat (api 19)</p>
  
  <p>When I run my app on the kitkat device, it shows my card view for a split second then it disappears.</p>
  
  <p>below is my xml layout:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:map="http://schemas.android.com/apk/res-auto"
      xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
      xmlns:fontawesometext="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="0dp"
      android:paddingLeft="0dp"
      android:paddingRight="0dp"
      android:paddingTop="0dp"
      tools:context="com.running.mattboyle.runnertoolbox.RunningMap"&gt;
  
  
      &lt;android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
          android:id="@+id/card_viewrunning"
          android:layout_gravity="center"
          android:layout_width="match_parent"
          android:layout_height="100dp"
          android:layout_marginTop="10dp"
          android:layout_marginLeft="10dp"
          android:layout_marginRight="10dp"
  
          android:background="@drawable/backgroundcard"
          card_view:cardCornerRadius="4dp"&gt;
  
          &lt;RelativeLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"&gt;
  
              &lt;Chronometer
              android:id="@+id/Duration"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentTop="true"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="16dp"
                  android:paddingLeft="10dp"
              android:text="0:00"
              android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
          &lt;TextView
              android:id="@+id/Calories"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginLeft="14dp"
              android:layout_marginTop="60dp"
              android:text="Calories: 0" /&gt;
          &lt;TextView
              android:id="@+id/pace"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="60dp"
              android:layout_alignParentRight="true"
              android:text="0:00"
              android:layout_marginEnd="60dp" /&gt;
  
              &lt;TextView
              android:id="@+id/paceunits"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="60dp"
                  android:text="min/km"
                  android:layout_alignParentRight="true"
                  android:layout_marginEnd="10dp" /&gt;
  
              &lt;TextView
                  android:id="@+id/distanceText"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_alignStart="@id/Duration"
                  android:layout_marginTop="52dp"
                  android:text="0.00"
                  android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
              &lt;TextView
                  android:id="@+id/distanceUnits"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_below="@+id/Duration"
                  android:layout_marginTop="12dp"
                  android:layout_marginLeft="5dp"
                  android:layout_toRightOf="@id/distanceText"
                  android:text="KM"
                  android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
  
          &lt;/RelativeLayout&gt;
  
  
      &lt;/android.support.v7.widget.CardView&gt;
  
      &lt;fragment
          android:id="@+id/map"
          android:name="com.google.android.gms.maps.MapFragment"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          &gt;
  
          &lt;com.beardedhen.androidbootstrap.BootstrapButton
          android:id="@+id/runButton"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_centerHorizontal="true"
          android:layout_marginBottom="5dp"
          android:text="Begin Run"
              android:layout_centerInParent="true"
  
          bootstrap:bb_type="primary" /&gt;
  
  
      &lt;com.beardedhen.androidbootstrap.BootstrapButton
          android:id="@+id/pauseButton"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_marginBottom="5dp"
          android:text="Pause"
          android:layout_centerHorizontal="true"
          android:paddingRight="120dp"
          bootstrap:bb_type="warning" /&gt;
  
      &lt;com.beardedhen.androidbootstrap.BootstrapButton
          android:id="@+id/EndButton"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_marginBottom="5dp"
          android:layout_centerInParent="true"
          android:layout_centerHorizontal="true"
          android:paddingLeft="120dp"
  
          android:text="End Run"
          bootstrap:bb_type="success"
  
          /&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;RelativeLayout
          android:layout_height="wrap_content"
          android:layout_width="fill_parent"
          android:layout_alignParentBottom="true"
          android:paddingBottom="40dp"&gt;
  
          &lt;com.beardedhen.androidbootstrap.BootstrapButton
              android:id="@+id/right"
              android:layout_width="70dp"
              android:layout_margin="10dp"
  
              android:layout_height="wrap_content"
              bootstrap:bb_type="primary"
              fontawesometext:fa_icon="fa-forward"
              android:text="Next"
              android:layout_alignParentRight="true"
              android:layout_marginEnd="10dp" /&gt;
  
          &lt;TextView
              android:layout_marginTop="15dp"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textAppearance="?android:attr/textAppearanceMedium"
              android:text="Calculating....."
              android:id="@+id/runLength"
              android:layout_centerHorizontal="true" /&gt;
  
  
          &lt;com.beardedhen.androidbootstrap.BootstrapButton
              android:layout_width="70dp"
              android:layout_height="wrap_content"
              bootstrap:bb_type="primary"
              android:text="Last"
              fontawesometext:fa_icon="fa-backward"
              android:id="@+id/left"
              android:layout_alignParentLeft="true"
              android:layout_marginStart="10dp" /&gt;
  
  
      &lt;/RelativeLayout&gt;
  
  &lt;/RelativeLayout&gt;
  
  
  What's extra weird is I have a cardview on my home screen too that opens and works just fine:
  
        &lt;android.support.v7.widget.CardView 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="180dp"
              android:background="@drawable/backgroundcard"
              card_view:cardCornerRadius="4dp"&gt;
  
              &lt;RelativeLayout
                  android:orientation="vertical"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:divider="@drawable/vertical_divider"
                  android:dividerPadding="12dip"
                  android:showDividers="middle"&gt;
  
                  &lt;TextView
                      android:id="@+id/weather"
                      android:textColor="@android:color/primary_text_light"
  
                      android:paddingTop="10dp"
                      android:paddingLeft="15dp"
  
                      android:layout_width="wrap_content"
                      android:layout_height="match_parent"
                      android:text="Weather"
                      android:textSize="25dp"
  
                      /&gt;
  
                  &lt;TextView
                      android:id="@+id/location"
                      android:textColor="@android:color/darker_gray"
  
                      android:paddingTop="130dp"
                      android:paddingLeft="40dp"
  
                      android:layout_width="wrap_content"
                      android:layout_height="match_parent"
                      android:text="Birmingham,UK"
  
                      /&gt;
  
  
                  &lt;ImageView
                      android:layout_width="130dp"
                      android:layout_height="130dp"
                      android:background="@drawable/nightcloud"
                      android:layout_marginTop="25dp"
                      android:layout_marginLeft="20dp"
                      android:layout_centerVertical="true"
  
                      android:id="@+id/weatherImage" /&gt;
  
  
                  &lt;TextView
                      android:id="@+id/low"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="05\u00B0"
                      android:paddingTop="75dp"
                      android:paddingRight="20dp"
                      android:layout_alignParentEnd="true"
                      android:textColor="@android:color/primary_text_light"
  
  
                      /&gt;
  
                  &lt;TextView
                      android:id="@+id/high"
                      android:textColor="@android:color/primary_text_light"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="10\u00B0"
                      android:paddingTop="95dp"
                      android:paddingRight="20dp"
                      android:layout_alignParentEnd="true" /&gt;
  
                  &lt;TextView
                      android:id="@+id/current"
  
                      android:textColor="@android:color/darker_gray"
                      android:textSize="50dp"
  
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="10\u00B0"
  
                      android:paddingRight="50dp"
                      android:layout_centerVertical="true"
                      android:layout_alignParentEnd="true" /&gt;
  
                  &lt;TextView
                      android:id="@+id/judgement"
  
  
                      android:paddingTop="10dp"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:textColor="@android:color/darker_gray"
  
                      android:text="Wear an underlayer, it is cold!"
                      android:paddingBottom="5dp"
                      android:paddingLeft="15dp"
  
                      android:layout_alignParentBottom="true"
                      android:layout_alignParentStart="true" /&gt;
              &lt;/RelativeLayout&gt;
  
          &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>Log cat doesn't offer any complaints.</p>
  
  <p>Android Studio documents this too:</p>
  
  <p><img src="https://i.stack.imgur.com/tnQtJ.png" alt="api 19">
  Api 19</p>
  
  <p><img src="https://i.stack.imgur.com/lb1xx.png" alt="api 21">
  api 21</p>
  
  <p>Any ideas? Would really appreciate any assistance. </p>
  
  <p>EDIT: I tried adding the line           findViewById(R.id.card_viewrunning).setVisibility(View.VISIBLE); to no prevail.</p>
  
  <p>Once again, this works perfectly on an api 21 device. Very strange one. </p>