Overriding loadCursor()


#1

Hi,

I’m wondering why RunListCursorLoader overrides loadCursor() which is used only in loadInBackground() instead of overriding loadInBackground() directly as RunLoader does.
What is the benefit?

Thanks,


#2

I think it is because RunLoader is a specific class designed to only load Run objects while SQLiteCursorLoader is a more general class to work with any database cursor. Of course, in the example it was only used to load RunManager.get(getContext()).queryRuns(), but you should always design for general cases when you can. In RunLoader and LastLocationLoader it seems designing for a more general case entails more headache than benefits