I know there is this question How to find text in android through a SearchView or EditText? but its not answering my question properly. I have an EditText in which there will be text. I want to find all the text occurences and highlight it like the Ctrl + F
in Google Chrome (Windows). Also, there will be a button like "Find Next". I got a image to tell what I want.
Got the image from How to find text in android through a SearchView or EditText?
I want all the specific text to be highlighted in yellow and the current text to be highlighted in read. Like the image above.
i think you can use this code. It should work perfectly for your case, the only difference is that instead of the foreach clause, you will have to use an int
than you can add the next button and foreach click doing
and than change the background of index recurrences and setting back the color of other recurrences to the default one.
if you have questions ask :)