I was using cancelRequest() from within my SyncAdapter, just before it exits its thread, but I then decided that was only intended to be used by another entity (UI) that wants to cancel a sync in progress (taking too long, oops, etc.)
Now my sync thinks there is always a pending request - which I use to ignore new requests.
The other thing that I have going is a listener thread in a Service that is listening for changes to the ContactsContract.AUTHORITY so it can kick off a sync of my aggregation.
UPDATE: This listener thread is leaking. I am issuing a .stop() when I am done with it, however, there is a handler that I think is staying alive and keeping the service from stopping.
I would like to send SyncResults to some entity (i.e., the SyncManager) that tracks such things for pending, recycle, etc.
What am I missing?
To elaborate on shunty's answer with an example:
Here is an example of setting the SyncResult. I just use it to set the number of exceptions in the stats field. The result I see then is that an error icon is displayed for that sync item in the Accounts & sync screen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With