Android – How to set cursor position in EditText

androidandroid-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?

Best Answer

Where position is an int:

editText1.setSelection(position)