0
I have three Edittext and need to check if the first Edittext is empty and if the second Edittext is also empty.
If Yes I must disable the third Edittext.
How can I do that?
0
I have three Edittext and need to check if the first Edittext is empty and if the second Edittext is also empty.
If Yes I must disable the third Edittext.
How can I do that?
1
A simple case that might satiate your problem would be, in case by clicking on editText, it does these checks and validations for you
editText1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String editText1_text = editText1.getText().toString();
String editText2_text = editText2.getText().toString();
if(editText1_text == null && editText2_text == null)
editText3_text.setVisibility(GONE);
else if(editText1_text != null && editText2_text != null)
editText3_text.setVisibility(VISIBLE);
}
});
editText2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String editText1_text = editText1.getText().toString();
String editText2_text = editText2.getText().toString();
if(editText1_text == null && editText2_text == null)
editText3_text.setVisibility(GONE);
else if(editText1_text != null && editText2_text != null)
editText3_text.setVisibility(VISIBLE);
}
});
At the touch of Edittext right? I’ll do here never tried this way...
This, when playing ediText Voce does the checking, but in this case in specific you will enable the third editText if the two others are different from null =)
you work with android too?
Yes work with android hehe
It’s test didn’t work out...
I’ll try with textChanged...
tmb is an option =) Textchanged checks every time an operation was performed in Edittext
Let’s go continue this discussion in chat.
Browser other questions tagged java android
You are not signed in. Login or sign up in order to post.
Right but to do the check you will click a button ?
– Dev
nay. The guy here said that from the moment you type a character in the first Edittext I can already enable the third Edittext for the guy to write....
– Aline
but it seems that it is more difficult
– Aline