Hey,
You have to make a new TextView in your xml file from your layout.
Than you can do something like this:
String[] from = new String[]{NotesDbAdapter.KEY_TITLE,
NotedDbAdapter.KEY_NAME};
int[] to = new int[]{R.id.text1, R.id.text2};
____
text 2 is the name from your new created TextView and KEY_NAME is an
example from a field from your database!
It's so easy as this to add more fields! If this isn't clear, feel
free to ask!
Wouter
On May 10, 10:36 am, daehoon <[email protected]> wrote:
> Here is code of Notepad Tutorial .
> It only display title in the list. I want to display two or more
> fields of DB to the list.
> anyone help?
>
> private void fillData() {
> Cursor notesCursor = mDbHelper.fetchAllNotes();
> startManagingCursor(notesCursor);
>
> // Create an array to specify the fields we want to display in
> the list (only TITLE)
> String[] from = new String[]{NotesDbAdapter.KEY_TITLE};
> int[] to = new int[]{R.id.text1};
> SimpleCursorAdapter notes =
> new SimpleCursorAdapter(this, R.layout.notes_row,
> notesCursor, from, to);
> setListAdapter(notes);
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---