Files
Notes/app
Tom Levy 433a7c1762 Fix missing .json file extension when exporting notes
The input from the user doesn't have a .json suffix. Previously, we
passed that value to ActivityResultContracts.CreateDocument as is
(without an extension), and relied on the file picker to automatically
append the extension based on the MIME type.

But some file pickers don't automatically append the extension, e.g.
the native Files app (com.android.documentsui) on Android <= 9, and
FossifyOrg/File-Manager. This results in the exported file not having
a .json extension.

Fix this by manually appending the .json extension before passing the
file name to CreateDocument.

Manually appending the extension shouldn't cause a problem for file
pickers that can automatically add an extension. For example the
native Files app doesn't add a second extension, and if the file
already exists it generates a unique name correctly, with the "(1)"
inserted before the extension, e.g. "Notes (1).json".

Fixes #13.
2024-01-31 06:38:31 +00:00
..
2024-01-08 17:20:13 +05:30
2016-02-13 21:05:54 +01:00
2023-12-23 15:39:02 +05:30
2023-12-23 17:00:12 +05:30