문제

I'm writing an AsyncTaskLoader for Android, and I'm wondering - should the caller (who presumably set everything up using a LoaderManager) expect me to call onLoadFinished with a full set of results each time, or can I simply return new results on every subsequent change?

Thanks!

EDIT

Put another way:

Let's say that I'm monitoring some data source, and during the first load, it returns A B C. Then, later, D and E become available. Do I return D E, or do I return A B C D E

도움이 되었습니까?

해결책

usually i use a loader to load a cursor => cursorloader, the cursor will always contain all data that fits its conditions. It doesnt distinguish between first and second time running, as it will everytime return anything there is.

in your case a b c d e

update

as i said im using this with a cursorloader to pull data from a db and pass it to a listview, you will have to implement a cursoradapter to display the Data from the DB.

There wont be any jitter, but you might want to think of some sort of animation while binding the data to the view, since it will pop up once its fully loaded(i dont know if you meant that by jitter).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top