This will reset the focus cursor to the last position of the text.
editText.setSelection(editText.getText().length());
This method will disable cursor movement when touched.
public class MyEditText extends EditText{ @Override public boolean onTouchEvent(MotionEvent event) { final int eventX = event.getX(); final int eventY = event.getY(); if( (eventX,eventY) is in the middle of your editText) { return false; } return true; } }
And you can use either the xml attribute
Android: cursorVisible
or java function
setCursorVisible (boolean)
to disable the flashing edittext cursor
Hein Jun 23 '12 at 15:04 2012-06-23 15:04
source share