I am a beginner in android programming and I would like to create a demo app for custom event listeners.

The app should do the followin:
My app should have an array of 30 numbers. From 0 to 29. And should traverse them in a loop.
When it finds a number for example 17 it triggers a custom event that sets for example the textView color to green.

How can I do that?