ListFragment displays wrong items
<p>I am new to the android api and I have some problems with .. the basics.
I'm trying to get a list working, but the list displays the wrong text:</p>

<p>Each row has two TextViews (title, subtitle), heres the xml:</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"
    android:orientation="horizontal"
    android:padding="5dip" &gt;

    &lt;TextView
        android:id="@+id/row_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TITLE"
        android:textSize="15dip"
        android:layout_gravity="center_vertical" /&gt;

    &lt;TextView
        android:id="@+id/row_subtitle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/row_title"
        android:text="SUBTITLE"
        android:textSize="10dip"
        android:layout_gravity="center_vertical" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>I extend ListFragment (I need this fragment thing, because of a slidingMenu library), have a custom adapter and an item class.
in the onActivityCreated() method I add some random items to the adapter:</p>

<pre><code>package com.slidingmenu.example;

import android.app.Fragment;
import android.app.ListFragment;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;


public class SampleListFragment extends ListFragment {

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.list, null);
    }

    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        SampleAdapter adapter = new SampleAdapter(getActivity());
        for (int i = 0; i &lt; 20; i++) {
            adapter.add(new SampleItem(new Fragment(), "title no. " + i, "some subtitle"));
        }
        setListAdapter(adapter);
    }

    private class SampleItem {
        public Fragment frag;
        public String title;
        public String subTitle;
        public SampleItem(Fragment frag, String title, String subTitle) {
            this.frag = frag; 
            this.title = title; 
            this.subTitle = subTitle;
        }
    }

    public class SampleAdapter extends ArrayAdapter&lt;SampleItem&gt; {

        public SampleAdapter(Context context) {
            super(context, 0);
        }

        public View getView(int position, View convertView, ViewGroup parent) {
            if (convertView == null) {
                convertView = LayoutInflater.from(getContext()).inflate(R.layout.row, null);
            }
            TextView title = (TextView) convertView.findViewById(R.id.row_title);
            TextView subTitle = (TextView) convertView.findViewById(R.id.row_subtitle);

            return convertView;
        }

    }
}
</code></pre>

<p>So I thougt that the list would display something like this:</p>

<pre><code>title no. 0
some subtitle
-
title no. 1
some subtitle
-
title no. 2
some subtitle
-

etc.
</code></pre>

<p>but instead it just displays what I defined in the row.xml:</p>

<pre><code>TITLE
SUBTITLE
-
TITLE
SUBTITLE
-

etc.
</code></pre>

<p>I think getView() needs to be changed (at least it doesn't make to much sense to me) but I'm not sure. 
Everything I try results in some nullpointer exception or worse.</p>

<p>Please, can someone tell me what I need to change?</p>
