Android Edit Text Cursor position doesn't change in first time
<p>I want to <strong>change position of Cursor</strong> in <code>EditText</code> after <strong>click on EditText</strong></p>

<p>I want change position Cursor to between ten - twelve after click, With click in <strong>first time</strong>.</p>

<p><a href="https://i.stack.imgur.com/mS8nHl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mS8nHl.png" alt="Image of text"></a></p>

<p>Here's my code:</p>

<pre><code>final EditText editText = (EditText) findViewById(R.id.editText);
    editText.setText(text1 + text2);
    editText.setSelection(text1.length());

    editText.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            editText.setSelection(editText.getText().length() - text2.length());
        }
    });

    editText.addTextChangedListener(new TextWatcher() {
        @Override
        public void beforeTextChanged(CharSequence s, int start, int before, int count) {
        }

        @Override
        public void onTextChanged(CharSequence s, int start, int count, int after) {
        }

        @Override
        public void afterTextChanged(Editable editable) {
            if (!editable.toString().contains(text1) || !editable.toString().contains(text2)) {
                editText.setText(text1 + text2);
                editText.setSelection(text1.length());
            }
        }
    });
}
</code></pre>