Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ section the body of the GitHub release, and refuses a version without one. `scri
- Saving a spreadsheet computes array formulas, `NOW`, `TODAY`, `OFFSET`, `INDIRECT`, and
formulas that refer to each other where the document allows it.
- Excel dates in the short formats show as Excel shows them.
- The app no longer crashes when it closes while a document has unsaved edits.

## 4.22.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,12 @@ class MainActivity : AppCompatActivity() {
* come from.
*/
fun confirmLeavingEdits(leave: () -> Unit) {
// onDestroy finishes the edit mode, which asks here: a dialog on a window that is going
// away throws BadTokenException. the edits go with the activity
if (isFinishing || isDestroyed) {
return
}

val documentFragment = this.documentFragment
if (documentFragment == null || !documentFragment.hasUnsavedEdits()) {
leave()
Expand Down
Loading