Skip to content

Commit

Permalink
Call save complete callback even when task not connected
Browse files Browse the repository at this point in the history
  • Loading branch information
philomates committed Jan 21, 2016
1 parent 4280aca commit b84949a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/src/org/odk/collect/android/tasks/SaveToDiskTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ public SaveToDiskTask(Uri mUri, Boolean saveAndExit, Boolean markCompleted, Stri
this.instanceContentUri = instanceContentUri;
this.symetricKey = symetricKey;
this.headless = headless;
this.taskId = SAVING_TASK_ID;
if (headless) {
this.taskId = -1;
} else {
this.taskId = SAVING_TASK_ID;
}
}

/**
Expand Down Expand Up @@ -346,13 +350,17 @@ private boolean exportXmlFile(ByteArrayPayload payload, OutputStream output) {


@Override
protected void deliverResult(R receiver, Integer result) {
protected void onPostExecute(Integer result) {
synchronized (this) {
if (mSavedListener != null)
mSavedListener.savingComplete(result, headless);
}
}

@Override
protected void deliverResult(R receiver, Integer result) {
}

@Override
protected void deliverUpdate(R receiver, String... update) {
}
Expand Down

0 comments on commit b84949a

Please sign in to comment.