0

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
}
Mingdi
  • 185
  • 1
  • 2
  • 7

1 Answers1

0

It's two different objects, so equals (== in Kotlin) will return false

check this answer

Ilia Kuzmin
  • 165
  • 8