I guess there is no horizontal scroll. If there is, you can extrapolate this answer. After seeing how you highlight matches, I am also going to assume that you have already found this part. This means that you must have at least a starting position for the search string in CharSequence .
Use Layout.getLineForOffset to find the row for the row, then Layout.getLineTop to get the position of the top of the row, then View.scrollTo to scroll to the desired position. It should look something like this:
Layout layout = textView.getLayout(); scrollView.scrollTo(0, layout.getLineTop(layout.getLineForOffset(startPos)));
I have not tried this, so you might have to do something to deal with the add-on you added, etc., but I think the general idea should work.
source share