Syntax highlighting on android EditText using Span?
Using string.indexOf(s) will get the first occurrence. Instead of having a map of keywords and using indexOf you could use a regular expression. I wrote this up real quick as an example: Screenshot of example EditText...