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:
Ensar Sarajčić 2023-08-16 13:32:53 +02:00
parent d98c9bc806
commit a24d3223a6
1 changed files with 1 additions and 1 deletions

View File

@ -131,7 +131,7 @@ class TextFragment : NoteFragment() {
if (savedInstanceState != null && note != null && savedInstanceState.containsKey(TEXT)) {
skipTextUpdating = true
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
}
}