Reputation: 309
boolean remindertextup = false;
remindertextup = text.contains("Unavailable");
if (value.contains("yes") && (remindertextup = true)){
//statement
}
But the if statement still works if text does not contain unavailable and value contains yes.
What am am I doing wrong?
Thank you.
P.S.: Eclipse shows the boolean remindertextup to be never used.
Upvotes: 1
Views: 66
Reputation: 532
In Java (like C and C++) '=' is an assignment. Try
if (value.contains("yes") && (remindertextup == true))
{
}
Upvotes: 0
Reputation: 16007
What you wrote in the if
clause sets remindertextup
to true
. Change it to:
(remindertextup == true)
Upvotes: 4