some time edit text cursor donot comes at particular position is if we directly use editText.setSelection(position);
.
In that case you can try
editText.post(new Runnable() {
@Override
public void run() {
editText.setSelection(string.length());
}
});