I am trying to check if a certain textbox's foreground matches a certain image and I tried the following but it did not work.
if(box.foreground == ContextCompat.getDrawable(box.context, R.drawable.image){
//Do this
}
It's two different objects, so equals (== in Kotlin) will return false
check this answer