Skip to content

Commit

Permalink
Protect form finish when activity is getting destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1g5 committed Apr 30, 2019
1 parent ae7d5eb commit 068bf1e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/src/org/commcare/activities/FormEntryActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1002,12 +1002,13 @@ protected void triggerUserQuitInput() {
* Call when the user is ready to save and return the current form as complete
*/
protected void triggerUserFormComplete() {

if (mFormController.isFormReadOnly()) {
finishReturnInstance(false);
} else {
int formRecordId = getIntent().getIntExtra(KEY_FORM_RECORD_ID, -1);
saveCompletedFormToDisk(instanceState.getDefaultFormTitle(formRecordId));
if(!isFinishing()) {
if (mFormController.isFormReadOnly()) {
finishReturnInstance(false);
} else {
int formRecordId = getIntent().getIntExtra(KEY_FORM_RECORD_ID, -1);
saveCompletedFormToDisk(instanceState.getDefaultFormTitle(formRecordId));
}
}
}

Expand Down

0 comments on commit 068bf1e

Please sign in to comment.