Is this the correct way to insert text at the cursor in Android?
- by Ben L.
myInput.setText(myInput.getText().replace(myInput.getSelectionStart(), myInput.getSelectionEnd(), "text"));
(myInput is an EditText)
I ask because I think this code is much longer than it needs to be - Is there something shorter like myInput.insertTextAtCursor("text") or is this the way everyone does it?