Search in sources :

Example 1 with SaveFormIndexTask

use of org.odk.collect.android.tasks.SaveFormIndexTask in project collect by opendatakit.

the class FormEntryActivity method nonblockingCreateSavePointData.

/**
 * Create save-points asynchronously in order to not affect swiping performance
 * on larger forms.
 */
private void nonblockingCreateSavePointData() {
    try {
        SavePointTask savePointTask = new SavePointTask(this);
        savePointTask.execute();
        if (!allowMovingBackwards) {
            FormController formController = getFormController();
            if (formController != null) {
                new SaveFormIndexTask(this, formController.getFormIndex()).execute();
            }
        }
    } catch (Exception e) {
        Timber.e("Could not schedule SavePointTask. Perhaps a lot of swiping is taking place?");
    }
}
Also used : FormController(org.odk.collect.android.logic.FormController) SaveFormIndexTask(org.odk.collect.android.tasks.SaveFormIndexTask) SavePointTask(org.odk.collect.android.tasks.SavePointTask) GDriveConnectionException(org.odk.collect.android.exception.GDriveConnectionException) JavaRosaException(org.odk.collect.android.exception.JavaRosaException)

Aggregations

GDriveConnectionException (org.odk.collect.android.exception.GDriveConnectionException)1 JavaRosaException (org.odk.collect.android.exception.JavaRosaException)1 FormController (org.odk.collect.android.logic.FormController)1 SaveFormIndexTask (org.odk.collect.android.tasks.SaveFormIndexTask)1 SavePointTask (org.odk.collect.android.tasks.SavePointTask)1