I have a TextView with an OnTouchListener. What I want is the character index the user is pointing to when I get the MotionEvent. Is t
TextView
OnTouchListener
MotionEvent
Have you tried something like this:
Layout layout = this.getLayout(); if (layout != null) { int line = layout.getLineForVertical(y); int offset = layout.getOffsetForHorizontal(line, x); // At this point, "offset" should be what you want - the character index }
Hope this helps...