Когда у EditText есть фокус, я хочу выделить весь текст внутри по умолчанию, но он не работает:
editText.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean hasFocus) {
if (hasFocus) {
// Go to the end
editText.setSelection(getEditTextView().getText().length());
// Select all the content
editText.selectAll();
}
}
});
Большое спасибо, ребята!