如何从Android活动访问SyncResult

如何从Android活动访问SyncResult,android,synchronization,android-activity,android-syncadapter,Android,Synchronization,Android Activity,Android Syncadapter,我有一个SyncAdapter,它在同步过程中使用SyncResultSyncStats将信息传回AndroidSyncManager,例如: public void onPerformSync(final Account account, Bundle extras, String authority, final ContentProviderClient provider, final SyncResult syncResult) { ... ++syncResult.stats

我有一个
SyncAdapter
,它在同步过程中使用
SyncResult
SyncStats
将信息传回Android
SyncManager
,例如:

public void onPerformSync(final Account account, Bundle extras, String authority,
   final ContentProviderClient provider, final SyncResult syncResult) {

...

++syncResult.stats.numInserts;
... 

}
在我的
活动
中访问这些统计信息会很有用,这样我就可以向用户显示其中的一些统计信息。同步完成后,如何从我的
活动
访问
SyncStats
?有办法做到这一点吗


编辑:还是最好通过正常的服务到活动通信(例如
AbstractService.send()
)来执行此操作?

我会在同步结束时发送一个广播,并将您需要的同步统计数据解析为广播目的的附加数据。您甚至可以使用粘性广播,但要注意它:)