Back to project page fh-android-sdk.
The source code is released under:
Copyright (c) 2014 FeedHenry Ltd, All Rights Reserved. Please refer to your contract with FeedHenry for the software license agreement. If you do not have a contract, you do not have a license to use...
If you think the Android project fh-android-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.feedhenry.sdk.sync; //from w ww . j a v a 2s.c o m import android.os.Handler; import android.os.Looper; import android.os.Message; public class FHSyncNotificationHandler extends Handler { private FHSyncListener mSyncListener; public FHSyncNotificationHandler(FHSyncListener pListener){ super(); mSyncListener = pListener; } public FHSyncNotificationHandler(Looper pLooper, FHSyncListener pListener){ super(pLooper); mSyncListener = pListener; } public void setSyncListener(FHSyncListener pListener){ mSyncListener = pListener; } public void handleMessage(Message pMsg){ int code = pMsg.what; NotificationMessage notification = (NotificationMessage) pMsg.obj; if(null != mSyncListener){ switch(code){ case NotificationMessage.SYNC_STARTED_CODE: mSyncListener.onSyncStarted(notification); break; case NotificationMessage.SYNC_COMPLETE_CODE: mSyncListener.onSyncCompleted(notification); break; case NotificationMessage.OFFLINE_UPDATE_CODE: mSyncListener.onUpdateOffline(notification); break; case NotificationMessage.COLLISION_DETECTED_CDOE: mSyncListener.onCollisionDetected(notification); break; case NotificationMessage.REMOTE_UPDATE_FAILED_CDOE: mSyncListener.onRemoteUpdateFailed(notification); break; case NotificationMessage.REMOTE_UPDATE_APPLIED_CODE: mSyncListener.onRemoteUpdateApplied(notification); break; case NotificationMessage.LOCAL_UPDATE_APPLIED_CODE: mSyncListener.onLocalUpdateApplied(notification); break; case NotificationMessage.DELTA_RECEIVED_CODE: mSyncListener.onDeltaReceived(notification); break; case NotificationMessage.SYNC_FAILED_CODE: mSyncListener.onSyncFailed(notification); break; case NotificationMessage.CLIENT_STORAGE_FAILED_CODE: mSyncListener.onClientStorageFailed(notification); default: break; } } } }