code: @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
  	public int getOffsetForPosition (float x, float y){
          if (getLayout() == null) return -1;
          final int line = getLineAtCoordinate(y);
          final int offset = getOffsetAtCoordinate(line, x);
          return offset;
  	}
docs: Get the character offset closest to the specified absolute position. A typical use case is to
  pass the result of {@link android.view.MotionEvent#getX()} and {@link android.view.MotionEvent#getY()} to this method.
  
  @param x The horizontal absolute position of a point on screen
  @param y The vertical absolute position of a point on screen
  @return the character offset for the character whose position is closest to the specified
  position. Returns -1 if there is no layout.