Skip to content

Commit a24d322

Browse files
committed
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.
1 parent d98c9bc commit a24d322

File tree

1 file changed

+1
-1
lines changed
  • app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments

1 file changed

+1
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/TextFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class TextFragment : NoteFragment() {
131131
if (savedInstanceState != null && note != null && savedInstanceState.containsKey(TEXT)) {
132132
skipTextUpdating = true
133133
val newText = savedInstanceState.getString(TEXT) ?: ""
134-
innerBinding.root.findViewById<MyTextView>(R.id.text_note_view).text = newText
134+
innerBinding.root.findViewById<TextView>(R.id.text_note_view).text = newText
135135
}
136136
}
137137

0 commit comments

Comments
 (0)