Only one set of Crime Title and Crime Date appear

I had the exact same bug, and yes, the problem was in list_item_crime.xml.

In the LinearLayout I had android:layout_height="match_parent" (which is what the new layout creation wizard will put there) but it should be android:layout_height="wrap_content" (otherwise it will fill the screen).

Full listing:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:padding="8dp">

    <TextView
        android:id="@+id/crime_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Crime Title"/>

    <TextView
        android:id="@+id/crime_date"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Crime Date"/>

</LinearLayout>
1 Like