mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-19 18:10:07 +01:00
Fix crash when restoring state on TextFragment
`onViewStateRestored()` in TextFragment crashed with `ClassCastException`, because layout has `MyEditText` with id `text_note_view` and not `MyTextView`. This has now been changed to `TextView` to ensure less breaking in the future and since only `text` was changed, this is enough. This happened when viewing notes and causing configuration change or something else that would cause the state to be restored.
This commit is contained in:
parent
d98c9bc806
commit
a24d3223a6
@ -131,7 +131,7 @@ class TextFragment : NoteFragment() {
|
|||||||
if (savedInstanceState != null && note != null && savedInstanceState.containsKey(TEXT)) {
|
if (savedInstanceState != null && note != null && savedInstanceState.containsKey(TEXT)) {
|
||||||
skipTextUpdating = true
|
skipTextUpdating = true
|
||||||
val newText = savedInstanceState.getString(TEXT) ?: ""
|
val newText = savedInstanceState.getString(TEXT) ?: ""
|
||||||
innerBinding.root.findViewById<MyTextView>(R.id.text_note_view).text = newText
|
innerBinding.root.findViewById<TextView>(R.id.text_note_view).text = newText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user