From 962b5b4fba9e6cb39465dd30874f4d9403497033 Mon Sep 17 00:00:00 2001 From: Gibran Chevalley Date: Fri, 5 Jul 2024 15:22:39 +0200 Subject: [PATCH] Move saving of the html where it actually matters onSaveInstanceState is cool for when you want to survive process being killed but onDestroyView is enough to survive configuration changes --- .../lib/richhtmleditor/sample/EditorSampleFragment.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sample/src/main/java/com/infomaniak/lib/richhtmleditor/sample/EditorSampleFragment.kt b/sample/src/main/java/com/infomaniak/lib/richhtmleditor/sample/EditorSampleFragment.kt index e517cd9..f38257f 100644 --- a/sample/src/main/java/com/infomaniak/lib/richhtmleditor/sample/EditorSampleFragment.kt +++ b/sample/src/main/java/com/infomaniak/lib/richhtmleditor/sample/EditorSampleFragment.kt @@ -146,12 +146,8 @@ class EditorSampleFragment : Fragment() { } } - override fun onSaveInstanceState(outState: Bundle) { - editorSampleViewModel.editorReloader.save(binding.editor) - super.onSaveInstanceState(outState) - } - override fun onDestroyView() { + editorSampleViewModel.editorReloader.save(binding.editor) super.onDestroyView() _binding = null }