I wrote a library with a custom view that was extended from EditText.
I want when user calls setText() cursor will stay at the same position
But by default EditText setText() moves cursor at the beggining
How can I fix it? Can I somehow override setText method (or other methods as bringPointToView() and so on)
EDIT 1: It is not a duplicate of this question
Because I want to override a standard behaviour of cursor at the Edittext.
And not force user of lib to call append() or setSelection()
EDIT 2: My Solution
@Override
public void setText(CharSequence text, BufferType type) {
super.setText(text, type);
if (getText() != null) {
Selection.setSelection(getText(), getText().length());
}
}