EditText extends a TextView , and all it does is set it for editing, so I read the source code for android.widget. TextView trying to figure out how EditText works.
I canโt understand how the editing mechanism works, the line is saved in mText , when users click somewhere in the view, where it knows where it is in the line (cursor position), and then inserts / deletes the text while doing this. It seems I canโt find the part of the code that handles this, insertion at a specific position. The relationship between the text on the display and mText. If you know how this works, I would appreciate an explanation.
source share