![JAR search and dependency download from the Maven repository](/logo.png)
co.easimart.SaveCallback Maven / Gradle / Ivy
package co.easimart;
/**
* A {@code SaveCallback} is used to run code after saving a {@link EasimartObject} in a background
* thread.
*
* The easiest way to use a {@code SaveCallback} is through an anonymous inner class. Override the
* {@code done} function to specify what the callback should do after the save is complete. The
* {@code done} function will be run in the UI thread, while the save happens in a background
* thread. This ensures that the UI does not freeze while the save happens.
*
* For example, this sample code saves the object {@code myObject} and calls a different
* function depending on whether the save succeeded or not.
*
*
* myObject.saveInBackground(new SaveCallback() {
* public void done(EasimartException e) {
* if (e == null) {
* myObjectSavedSuccessfully();
* } else {
* myObjectSaveDidNotSucceed();
* }
* }
* });
*
*/
public interface SaveCallback extends EasimartCallback1 {
/**
* Override this function with the code you want to run after the save is complete.
*
* @param e
* The exception raised by the save, or {@code null} if it succeeded.
*/
@Override
public void done(EasimartException e);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy