api level above 14, this example uses TextView.getOffsetForPosition