views:

27

answers:

1

How can I link like the Checkbox and larger TextView to external data? Should I use a SimpleCursorAdapter? Or create my own adapter? Should it extend ArrayAdapter or BaseAdapter?
My list item UI:

The list item UI

+1  A: 

If you are binding that view to data in a SQLite database, I would extend CursorAdapter. It's pretty easy as you only have to override bindView() and newView(). In newView() you need to use a LayoutInflater to inflate the view, and in bindView(), you define the views as objects and bind your data to them! Ask if you need some example code and I'll dig some up from an old project!

ZachM
I figured out how to create a custom CursorAdapter. But I don't really know how to USE it with a SQLite database? In my SQLite database adapter, I have a getAllTasks() that returns a Cursor. Should I use that in my ListActivity? Like: CustomCursorAdapter(this, CustomDBAdapter.getAllTasks()); ?
Mohit Deshpande