1 or 2 is filled then 3 does not need to be checked, if 1 or 2 is empty - then it is necessary
It cannot be that one of them will be filled, but it will not be empty.
For clarity, your text boxes can be:
| пустой | заполненный TextBox 1 | + | - TextBox 2 | + | - --------------------------------- TextBox 1 | + | - TextBox 2 | - | + --------------------------------- TextBox 1 | - | + TextBox 2 | + | - --------------------------------- TextBox 1 | - | + TextBox 2 | - | +
You ask it:
| пустой | заполненный TextBox 1 | - | + TextBox 2 | - | - --------------------------------- TextBox 1 | - | - TextBox 2 | - | +
We will analyze your condition:
1 or 2 is full then 3 does not need to be checked
If 1 or 2 is full, then 2 or 1 will be empty, respectively.
if 1 or 2 is empty - you need
If 1 or 2 is empty, then 2 or 1 will be filled accordingly.
UPD:
According to the commentary , you still need to check for 2 empty fields. Accordingly, I can offer to improve the readability of the code:
boolean isFirstEmpty = TextUtils.isEmpty(one); boolean isSecondEmpty = TextUtils.isEmpty(two); if (isFirstEmpty && isSecondEmpty ) { //check editText 3 }
Но всегда одно значение получается true другое false- give an example. - post_zeewifblock only if the field is filled in and 1 and 2, but this is not what I need as you understand .. I need one filled floor (either 1 or 2)ifblockifnot executed - Aleksey Timoshchenko