How do you programmatically remove the selection from an EditText
? I've tried:
myEditText.setSelection(selectionEnd);
but that just creates a selection of 0 length at the end of the current selection. I've also tried Selection.removeSelection(mySpannable)
, and it just puts an empty selection at the beginning of the text.
Tap the conversation. Touch and hold the message you want to delete. Optional: To delete multiple messages, touch and hold the first message, then tap more messages. Tap Delete to confirm.
In your xml code set focusable="false" , android:clickable="false" and android:cursorVisible="false" and this will make your EditText treat like non editable.
To move selection to top:
edit_text.setSelection(0);
To move selection to bottom:
edit_text.setSelection(edit_text.getText().length());
Calling myEditText.clearFocus();
. I think that's what you need
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With