android - infinite sync loop syncadapter -


i have same problem stated here: android syncadapter stuck in infinite sync loop

but after trying implement notifychange (uri uri, contentobserver observer, boolean synctonetwork) in onperformsync, realized didn't know how contentobserver needed (which defined , passed in in main activity)

any tips?

edit 1:

like person first time sync loops indefinitely

i found contentresolver.cancelsync(account, authority); work well, if has better solution...please let me know!

edit 2:

i followed advice post android syncadapter automatically initialize syncing

after stepping through debugger, confirmed synctonetwork false when passed notifychange, yet infinite sync continues without cancelsync...still no permanent solution

i asked question time ago when dipping toes android programming, , figured i'd share found who's curious. when following tutorials implement custom contentprovider, saw notifychange (uri uri, contentobserver observer) used after update(), insert() , delete() methods. not knowing anything, called notifychange in contentprovider. led problems infinite sync loops not figure out. there overloaded method: notifychange (uri uri, contentobserver observer, boolean synctonetwork) knew then, never figure out how use because notifychange being called in contentprovider. easy fix. had call notifychange (uri, null, false) not in contentprovider, rather, after calling methods through contentresolver getcontentresolver().insert() etc.

i hope helps someone.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -