Search code examples
androidandroid-edittext

How to set cursor position in EditText?


There are two EditText,while loading the page a text is set in the first EditText, So now cursor will be in the starting place of EditText, I want to set cursor position in the second EditText which contains no data. How to do this?


Solution

  • Where position is an int:

    editText1.setSelection(position)