I implemented SyncAdapter, AccountManager and private ContentProvider according to the SimpleSyncAdapter sample project in the SDK. Everything works well.
Now I want to show a message to the user when new lines were downloaded from a remote server with a specific set of flags. I need a callback from the SyncAdapter when the synchronization is complete, so I can execute the request and display a message from the activity. I saw several questions about StackOverflow that discussed this, but no one answered a good answer.
How can I listen to the progress from Android SyncAdapter? says SyncStatusObserver is useless. The mobibob user suggests using ResultReceiver to respond to the user interface from the synchronization stream.
How do I know when synchronization is complete? suggests using Intent in SyncService.
How to signal synchronization with Android SyncManager? suggests using SyncResult. The sample code associated with maxpower47 uses the SyncResult class to report exceptions, but not to actually report the completion of synchronization.
I just donβt know what is the best option, and I have not seen any examples of projects that use any of these solutions.
android synchronization callback android-syncadapter
JosephL
source share