title: How to display Android database content?
body: <p>I'm back with another question regarding Android databases.</p>
  
  <p>I'm storing a simple string into my android database and then wish to display all the entries as a list. However, the list shows nothing on my emulator (or my actual device) and neither does LogCat (either when saving entries into the DB or when calling them).</p>
  
  <p>Below you have my code</p>
  
  <ul>
  <li><p>the save entries function:</p>
  
  <pre><code>public long createEntry(String entry){
  ContentValues initialValues = new ContentValues();
  initialValues.put(KEY_ENTRY, entry);
  
  return db.insert(DATABASE_TABLE, null, initialValues);
  }
  </code></pre></li>
  <li><p>the get entries function:</p>
  
  <pre><code>public Cursor fetchAllEntries(){
  return db.query(DATABASE_TABLE,new String [] {KEY_ROW_ID, KEY_ENTRY}, null, null, null, null, null);
  }
  </code></pre></li>
  <li><p>the List Activity:</p>
  
  <pre><code>entryList = (ListView)findViewById(R.id.recordsList);
  Cursor c = dbAdapter.fetchAllEntries();
  
  if(c!=null){
      startManagingCursor(c);
      String [] from = new String [] {PirelliDbAdapter.KEY_ENTRY};
      int [] to = new int [] {R.id.text1};
  
      SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.entryrow, c, from, to);
      entryList.setAdapter(adapter);
  }
  
  dbAdapter.close();
  </code></pre></li>
  <li><p>And finally the List Activity's XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical" &gt;
  
  &lt;ListView
  android:id="@+id/recordsList"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent" /&gt;
  
  &lt;TextView
  android:id="@+id/textViewList"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre></li>
  </ul>
  
  <p>Thanks a lot for taking the time to look over this and help me out. I'm really stumped and don't know where to go from here...</p>