Android Forum » Android Developer Forum » Android Developer Forum » android edittext cursor back side moving

android edittext cursor back side moving

android edittext cursor back side moving
created on Sep 14, 2011 6:53:59 AM
I'm using gestures in android now i need small help when ever my gestures action will be equl my edit text cursor will be need to go back(like move back arrow) my code is

if (prediction.equals("Move")) {
?????????
}

it will be happen for gestures operation
Reply with quote Reply Link ±0     (0 votes)
RE: android edittext cursor back side moving
created on Sep 14, 2011 9:58:09 PM
There is no "move cursor" method for an editText, but I believe you can set the cursor position using the setSelection method. Try doing this:

int cursorPos = myEditText.getSelectionStart();
cursorPos--;
if (cursorPos<0) cursorPos=0;
myEditText.setSelection(cursorPos)
Reply with quote Reply Link ±0     (0 votes)