> CursorAdapter is great, i'm a big fan. > > i notice that both newView() and bindView() are passed Cursors, > indicating that extracting stuff from the Cursor and sticking it in > the view should happen inside those overrides.
Actually, newView() should just create the empty views, so bindView() can be used for binding in either the new-view or recycled-view cases. > however in the source for CursorAdapter.getView() i see that > bindView() gets called whether the view is recycled or not. in the > new view case, this causes a redundant Cursor to View copy. > > IMHO, CursorAdapter should call newView() if the view couldn't be > recycled, or bindView() if it could. Given the regression this would require, it is simpler if we just set up our newView() and bindView() implementations to deal with this particular aspect of CursorAdapter. Note that I had this screwed up in an earlier edition of one of my books, so some of the confusion may be my fault. :-( -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---