title: Listview only showing 1 result from query
body: <p>So I finally got my listview to display result(s) from my db query, but for some reason its only showing 1, the last.</p>
  
  <pre><code>public class PastGames extends ListActivity {
  
  @Override
  
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      //setContentView(R.layout.pastgames);
  
  
  
      DBAdapter db = new DBAdapter(this);
  
      db.open();
      Cursor c = db.getAllFinalscores();
      if (c.moveToFirst())
      {
          do {
              String[] listData = new String [] {"Date: " + c.getString(1) + "\n" +
                      "Strokes: " + c.getString(2) + "\n" + "Holes: " + c.getString(3)};
              this.setListAdapter(new ArrayAdapter&lt;String&gt;(this,
                      R.layout.pastgames, listData));
          }
          while (c.moveToNext());
      }
      db.close();
  
  
  }
  }
  </code></pre>
  
  <p>dbadapter</p>
  
  <pre><code>//***RETRIEVES ALL THE FINALSCORES***//
  public Cursor getAllFinalscores()
  {
      return db.query(DATABASE_TABLE, new String[] {
              KEY_ROWID,
              KEY_DATE,
              KEY_FINALSCORE,
              KEY_HOLESPLAYED},
              null, null, null, null, null);
  }
  </code></pre>
  
  <p>Could someone let me know what I am doing wrong?  Why is it not displaying each row in the db?</p>
  
  <p>EDIT:  Here is my xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TextView 
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@id/android:list"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textSize="16sp"
      android:padding="10dp"/&gt;
  </code></pre>
  
  <p>NEW (Correct way):</p>
  
  <pre><code>public class PastGames extends ListActivity {
  
  @Override
  
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      //setContentView(R.layout.pastgames);
  
  
      db.open();
      Cursor c = db.getAllFinalscores();
      String[] listData = new String[c.getCount()];
      if (c.moveToFirst())
      {
      do {
  
          listData[c.getPosition()] = "Date: " + c.getString(1) + "\n" +
              "Strokes: " + c.getString(2) + "\n" + "Holes: " + c.getString(3);
      }
          while (c.moveToNext());
          this.setListAdapter(new ArrayAdapter&lt;String&gt;(this,
              R.layout.pastgames, listData));
      }
      db.close()
  }
  
  }
  </code></pre>