Search code examples
androidsqlitelistviewandroid-cursoradapter

is there a way to use cursor adapter to display a list whose items are backed by sqlite


I have a list of items that I wish to map onto a ListView, but the individual fields of those items may or may not be backed by sqlite. If the item is not backed by sqlite, I'd like to just display some default values and the id. Is there a way to do this using SimpleCursorAdapter or should I look elsewhere?


Solution

  • As you want some specialist behaviour, you might be better off creating your own CursorAdapter implementation by extending CursorAdapter (or SimpleCursorAdapter). It's not too tricky and there are some good examples available with a quick search.