title: Why is my custom ListView not showing all the widgets?
body: <p>I am writing an appointments application with a customised Listview. The ListView consists of a </p>
  
  <ul>
  <li>View, whose colour indicates priority</li>
  <li>Checkbox, to select the item with.</li>
  <li>DateText, to show what date the appointment is</li>
  <li>MonthText, to show what month the appointment is</li>
  <li>TimeText, to show when the appointment is</li>
  <li>Title, which stores the summary of the appointment</li>
  </ul>
  
  <p>Each row in the listView should look something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/5Snz3.png" alt="enter image description here"></p>
  
  <p>But only two widgets are visible: DateText and MonthText. The rest are not. Why is this the case?</p>
  
  <p><img src="https://i.stack.imgur.com/hiv0L.png" alt="enter image description here"></p>
  
  <p>My <code>XML</code> and <code>getView()</code> method are below:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  
      &lt;View
          android:id="@+id/priorityView"
          android:layout_width="20dip"
          android:layout_height="wrap_content"
          android:background="#cccccc"
          android:layout_alignParentLeft="true" /&gt;
  
      &lt;CheckBox
          android:id="@+id/selectedCheckbox"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@id/priorityView"
          android:layout_alignTop="@id/priorityView"
          android:layout_toRightOf="@id/priorityView"
          android:gravity="center"&gt;
      &lt;/CheckBox&gt;
  
      &lt;TextView
          android:id="@+id/dateText"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignTop="@id/priorityView"
          android:layout_toRightOf="@id/selectedCheckbox"
          android:gravity="center"
          android:paddingBottom="2dip"
          android:paddingLeft="5dip"
          android:paddingRight="5dip"
          android:paddingTop="2dip"
          android:text="@string/empty"
          android:textSize="20dip"
          android:textStyle="bold" /&gt;
  
      &lt;TextView
          android:id="@+id/monthText"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@id/monthText"
          android:layout_alignLeft="@id/dateText"
          android:layout_alignRight="@id/dateText"
          android:layout_below="@id/dateText"
          android:gravity="center"
          android:padding="5dip"
          android:text="@string/empty"
          android:textSize="10dip" &gt;
      &lt;/TextView&gt;
  
      &lt;TextView
          android:id="@+id/timeText"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@id/priorityView"
          android:layout_alignTop="@id/priorityView"
          android:layout_toRightOf="@id/dateText"
          android:gravity="center"
          android:padding="5dip"
          android:text="@string/empty" &gt;
      &lt;/TextView&gt;
  
      &lt;TextView
          android:id="@+id/titleText"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@id/priorityView"
          android:layout_alignParentRight="true"
          android:layout_alignTop="@id/priorityView"
          android:layout_toRightOf="@id/timeText"
          android:gravity="center"
          android:padding="5dip"
          android:text="@string/empty" &gt;
      &lt;/TextView&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>getView()</p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup parent) {
  
                      // List views that go off the screen are recycled.
  
                      View recycledView = convertView;
  
                      if (recycledView == null) {
                          /*
                           * If there is no view to recycle (e.g. when the listview is
                           * first created) we must inflate the view from the xml file
                           * using Layout Inflater.
                           */
  
                          LayoutInflater inflater = (LayoutInflater) context
                                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
                          recycledView = inflater.inflate(R.layout.row, null);
                      }
  
                      /*
                       * We now have a view to work with. We will now fill in the contents
                       * of this list view item.
                       */
  
                      Appointment current = items.get(position);
                      if (current != null) {
  
                          Log.e("crap",current.toString());
  
                          View priorityIndicator = (View) recycledView.findViewById(R.id.priorityView);
                          CheckBox selectedCheckbox = (CheckBox) recycledView.findViewById(R.id.selectedCheckbox);
                          TextView dateText = (TextView) recycledView.findViewById(R.id.dateText);
                          TextView monthText = (TextView) recycledView.findViewById(R.id.monthText);
                          TextView timeText = (TextView) recycledView.findViewById(R.id.timeText);
                          TextView titleText = (TextView) recycledView.findViewById(R.id.titleText);
  
                          //Set priority indictor to appropriate colour.
                          selectedCheckbox.setChecked(true);
  
                          switch (current.getPriority()) {
                          case PRIORITY_LOW:
                              priorityIndicator.setBackgroundColor(Color.BLUE);
                              break;
  
                          case PRIORITY_NORMAL:
                              priorityIndicator.setBackgroundColor(Color.GREEN);
                              break;
  
                          case PRIORITY_HIGH:
                              priorityIndicator.setBackgroundColor(Color.RED);
                              break;
  
                          default:
                              priorityIndicator.setBackgroundColor(Color.GRAY);
                              break;
                          }
  
                          //Leave the selected checkbox alone.
  
                          //Set dateText to show the date of the appointment
                          dateText.setText("29");
                          monthText.setText("SEP");
                          timeText.setText("11:00");
                          titleText.setText(current.getTitle());
                      }
  
                      return recycledView;
                  }
  </code></pre>