From 1dc8299438f6872950a3f2709aa2845b8fa3f508 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 15 Mar 2020 21:39:34 +0100 Subject: [PATCH] remember last used file name and extension at Android 11 too --- .../simplemobiletools/draw/pro/activities/MainActivity.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/draw/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/draw/pro/activities/MainActivity.kt index 6508ef9..3306d69 100644 --- a/app/src/main/kotlin/com/simplemobiletools/draw/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/draw/pro/activities/MainActivity.kt @@ -373,6 +373,10 @@ class MainActivity : SimpleActivity(), CanvasListener { SaveImageDialog(this, defaultPath, defaultFilename, defaultExtension, true) { fullPath, filename, extension -> val mimetype = if (extension == SVG) "svg+xml" else extension + defaultFilename = filename + defaultExtension = extension + config.lastSaveExtension = extension + Intent(Intent.ACTION_CREATE_DOCUMENT).apply { type = "image/$mimetype" putExtra(Intent.EXTRA_TITLE, "$filename.$extension") @@ -396,7 +400,7 @@ class MainActivity : SimpleActivity(), CanvasListener { defaultFilename = filename defaultExtension = extension config.lastSaveFolder = defaultPath - config.lastSaveExtension = defaultExtension + config.lastSaveExtension = extension } }