mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-02 18:00:12 +02:00
fix a glitch with disappearing note values
This commit is contained in:
parent
fbc58abeb0
commit
8969a1a426
@ -101,12 +101,14 @@ class NoteFragment : androidx.fragment.app.Fragment() {
|
|||||||
|
|
||||||
override fun onSaveInstanceState(outState: Bundle) {
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
super.onSaveInstanceState(outState)
|
super.onSaveInstanceState(outState)
|
||||||
outState.putString(TEXT, getCurrentNoteViewText())
|
if (note != null) {
|
||||||
|
outState.putString(TEXT, getCurrentNoteViewText())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onViewStateRestored(savedInstanceState: Bundle?) {
|
override fun onViewStateRestored(savedInstanceState: Bundle?) {
|
||||||
super.onViewStateRestored(savedInstanceState)
|
super.onViewStateRestored(savedInstanceState)
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null && note != null && savedInstanceState.containsKey(TEXT)) {
|
||||||
skipTextUpdating = true
|
skipTextUpdating = true
|
||||||
val newText = savedInstanceState.getString(TEXT) ?: ""
|
val newText = savedInstanceState.getString(TEXT) ?: ""
|
||||||
view.notes_view.setText(newText)
|
view.notes_view.setText(newText)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user