I’m facing very good problem internet problems
I’ve AndroidView which contains EditText. I’m not hoisting the state instead letting editText hold its own state. But sometimes I want to set text from out side, lets say I want to undo the last text so how do I do it?
b
brandonmcansh
06/09/2022, 2:14 PM
pass in
text
and key the remembered internal one off the provided
text
so it recalculates when its changed.
j
jasu
06/09/2022, 3:37 PM
It doesn't work, when I try to set a text in update block of AndroidView in editText using setText method it adds text at first position and a cursor remains at 0 index always
l
lilypuchi
06/09/2022, 5:36 PM
I guess it’s an issue with
EditText.setText()
itself. Using it to set text doesn’t alter cursor position and we then explicitly have to call
EditText.setSelection()
to reposition it at the end. There’s no alternative I can think of