As you will realise while reading this, I am new to programming, and I am very much stuck.
I have 5 text views in the layout with ID´s "box_one_text , box_two_text" and so on, when I try to set the click listeners on MainActivity, I create a list of items calling for each textView by it's ID:
private fun setListeners(){
val clickableViews: List<View> =
listOf(box_one_text, box_two_text, box_three_text, box_four_text,
box_five_text, constraint_layout)
for(item in clickableViews){
item.setOnClickListener { makeColored(it) }
}
}
Everything inside listOf is an error, calling for the "Unresolved reference" I talked about earlier)
How do I fix this?