How to set cursor position in EditText?

前端 未结 23 1566
广开言路
广开言路 2020-11-28 02:51

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

23条回答
  •  孤独总比滥情好
    2020-11-28 03:11

    If you want to set cursor position in EditText? try these below code

    EditText rename;
     String title = "title_goes_here";
     int counts = (int) title.length();
     rename.setSelection(counts);
     rename.setText(title);
    

提交回复
热议问题