|
Sync Android SDK
0.8.7
|
Observer for all operations on a Document. More...
Public Member Functions | |
| DocumentObserver () | |
| Keep default constructor, you don't need to override it. More... | |
| void | onOpened (Document doc) |
| This callback is invoked when Document object has been initialised and opened locally. More... | |
| void | onRemoved (EventContext context) |
| This callback is invoked when entire Document has been removed by a local request. More... | |
| void | onUpdated (EventContext context, JSONObject data, JSONObject prevData) |
| This callback is invoked when a Document has been modified by a local request. More... | |
| void | onErrorOccurred (ErrorInfo error) |
| This callback is invoked when a Document operation has encountered an error. More... | |
Observer for all operations on a Document.
You should create your own subclass of DocumentObserver and override functions you are interested in.
Observer will receive callbacks for all operations on a Document. To distinguish parallel streams of local operations your application could use local flow identifier.
Callbacks in the observer will be called from a background thread. You will need to repost your work to UI thread if you do any UI-related operations in the callback.
| com.twilio.sync.DocumentObserver.DocumentObserver | ( | ) |
Keep default constructor, you don't need to override it.
If you do override make sure to call the inherited constructor.
| void com.twilio.sync.DocumentObserver.onErrorOccurred | ( | ErrorInfo | error | ) |
This callback is invoked when a Document operation has encountered an error.
| error | Error description. |
| void com.twilio.sync.DocumentObserver.onOpened | ( | Document | doc | ) |
| void com.twilio.sync.DocumentObserver.onRemoved | ( | EventContext | context | ) |
This callback is invoked when entire Document has been removed by a local request.
| context | Context indicating if change was local or remote. |
| void com.twilio.sync.DocumentObserver.onUpdated | ( | EventContext | context, |
| JSONObject | data, | ||
| JSONObject | prevData | ||
| ) |
This callback is invoked when a Document has been modified by a local request.
| context | Context indicating if change was local or remote. |
| data | New contents of the document. |
| prevData | Previous contents of the document. |