devadnqpnd
devadnqpnd

Reputation: 156

Setting input type in EditTextView programmatically makes the cursor go back to the start of EditTextView

When the user typed # in EditTextView I set its input type to InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD. By doing that the effect was the cursor is going back to the start of the EditTextView.

Upvotes: 1

Views: 120

Answers (1)

Joachim
Joachim

Reputation: 2771

You should be able to add something like the following after setting the input type

editText.setSelection(editText.getText().length());

I know It's not exactly ideal but I'm pretty sure it's the only way to get the behavior you want.

Upvotes: 2

Related Questions