Vahan
Vahan

Reputation: 3268

CustomSimpleCursorAdapter vs ViewBinder?

I have a list of items which is fetched from the local database. Every item has property isNew. I want to make visible TextView with text "new" only for items which match isNew = true. I solve this problem with two ways, and now I want to know which is best method.

Method 1:

I write a class MyViewBinder which implements SimpleCursorAdapter.ViewBinder and overrides public boolean setViewValue(view, cursor, columnIndex) method with my logic next to that.

Method 2:

Create MySimpleCursorAdapter which extends SimpleCursorAdapter, overwrite getView method and wrote logic there.

Now I'm working with the second method. Can anyone suggest me which is the best method or if there any other best methods.

Upvotes: 1

Views: 190

Answers (1)

Vasiliy D. Rylov
Vasiliy D. Rylov

Reputation: 26

If, depending on the value of the column is necessary to make many changes over the item in the list, the second method is more convenient.

Upvotes: 1

Related Questions