If statement: Assignments are not expressions, and only expressions are allowed in this context kotlin

99 Views Asked by At

I keep getting an error message in my if statement:

 fun someFunction(){
    if (requestCode == 0 && resultCode = Activity.RESULT_OK && data != null) { 
        // Do stuff
    }
 }
1

There are 1 best solutions below

1
mac229 On

It should be resultCode == Activity.RESULT_OK