Hi all, I am trying to implement a very simple "todo" list.
I chose to use a ListView of CheckedTextView (with id checked_text),
the ListView uses CHOICE_MODE_MULTIPLE of course.
Now, I am using the SQLite database to store the list items.
To fill the list I have something like:
----
cursor = dbHelper.fetchAll();
startManagingCursor(cursor);
String[] from = new String[] { DbAdapter.NAME };
int[] to = new int[] { R.id.checked_text };
SimpleCursorAdapter notes = new SimpleCursorAdapter(this,
R.layout.todo_multi_row, cursor, from, to);
listView.setAdapter(notes);
-----
This is working fine, it gets all the items in the DB and for each
item it creates a CheckedTextView with as text DbAdapter.NAME.
But what I really need is to get both the text, and the checked state,
and check the Rows accordingly.
Let's say I can get the state (as integer 0/1) from the DB using
DbAdapter.CHECKED.. how can I implement a cursor adapter that gets the
job done?
I searched everywhere but found nothing to solve this problem. Wah. It
seemed so easy at first.
Thanks,
Stefano
--
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