I'm developing an Input Method.
I'd like to change cursor position with
*InputConnection.setSelection<http://developer.android.com/reference/android/view/inputmethod/InputConnection.html#setSelection(int,
int)>*.
This method allows me to set absolute position of cursor.
But what I want is to move cursor relatively from current position.
(e.g. Move left 3 characters from current position)
I can't find method to get current cursor position.
Currently, I got this hack:
InputConnection conn;
CharSequence seq = conn.getTextBeforeCursor(1000, 0);
// will get as much characters as possible on the left of cursor
int cursor_pos = seq.length();
Is there any better way to do this?
Should we introduce new method to InputConnection, i.e. getSelectionStart?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en