We have an AsyncTaskLoader in which in the function loadInBackground
we query a content provider.
On return of the query we get a cursor from the provider.
Now on this cursor we have set a ForceLoadContentObserver
as below :
private final ForceLoadContentObserver mObserver = new ForceLoadContentObserver();
cursor.registerContentObserver(mObserver);
Now when we change a particular file, the provider has done notifyChange
.
In normal cases, this notifyChange triggers the loadInBackground of my loader which will then requery the provider for fresh data.
But in some cases, the loadInBackground
is not triggered on notifyChange
.
Reason: When a notifyChange is done by ContentProvider, my loader's loadInBackground is called on some worker thread. In issue scenario my loadinBackground is not finished and the provider do a new notifyChange. It seems that the new notifyChange is ignored by the system.
What can be the solution for this?