The search highlights the word in the TextView , it is in the ScrollView container.

It is necessary for the focus to shift (automatically scroll) to the highlighted (found) word, if it is out of view of the screen.

Tell me, who knows, maybe there is a link to the example?

 private void searchFor(String paramString) { int i = 0; TextView localTextView = (TextView)findViewById(R.id.textView); Spannable localSpannableString = new SpannableString(localTextView.getText()); BackgroundColorSpan[] arrayOfBackgroundColorSpan = (BackgroundColorSpan[])localSpannableString.getSpans(0, localSpannableString.length(), BackgroundColorSpan.class); int j = arrayOfBackgroundColorSpan.length; while (i < j) { localSpannableString.removeSpan(arrayOfBackgroundColorSpan[i]); i++; } for (int k = TextUtils.indexOf(localSpannableString, paramString); k >= 0; k = TextUtils.indexOf(localSpannableString, paramString, k + paramString.length())) { localSpannableString.setSpan(new BackgroundColorSpan(Color.parseColor("#FFEA00")), k, k + paramString.length(), 33); } localTextView.setText(localSpannableString); // search.setSelection(search.getText().length()); } public boolean onEditorAction(TextView paramTextView, int paramInt, KeyEvent paramKeyEvent) { if ((paramKeyEvent == null) || (paramKeyEvent.getAction() == 1)) { searchFor(this.search.getText().toString()); ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(paramTextView.getWindowToken(), 0); } return true; } 

enter image description here

    0