Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SimpleCursorAdapter vs CursorAdapter?

I have some cursor with data. I have TextView which visibility depends on some property of the item of cursor. I use SimpleCursorAdapter and override getView method. But I am actually not use from and to properties of SimpleCursorAdapter.

Is it better to change my adapter to CursorAdapter and override newView and bindView methods?

like image 255
Vahan Avatar asked Sep 29 '12 10:09

Vahan


1 Answers

CursorAdapter is abstract and is to be extended. On the other hand, SimpleCursorAdapter is not abstract.

Notice that newView(Context context, Cursor cursor, ViewGroup parent) is abstract in CursorAdapter but implemented in SimpleCursorAdapter. This is because SimpleCursorAdapter has a specific mechanism to initiate views while CursorAdapter leaves it up to the developer.

Source : SimpleCursorAdapter and CursorAdapter

Added:

I have TextView which visibility depends on some property of the item of cursor.

For this you can check SimpleCursorAdapter.ViewBinder interface.

like image 120
Vishal Vyas Avatar answered Sep 28 '22 03:09

Vishal Vyas