4
I would like to know how I do to test whether a Edittext is empty or filled on Android.
For example, I want to make an app that will perform a registration, but there are fields that cannot be empty so, I would like to know how to do this test, in case, if there was an empty field, it would return a message saying that the fields cannot be empty.
getText()
never returnsnull
.– Piovezan
compare so clength() == 0** that vc will leave that has nothing filled, that is null anyway. try to put a meuEditText.gettext(). toString(). If the size is zero is null, nothing is filled
– FlipNovid
Hence yes, then edit your answer.
– Piovezan
@Piovezan the guy wants the answer, not put any code, then I’ll help, put something for him to think a little, and you diminish me, will understand. :(
– FlipNovid
I just asked you to correct your answer, which was incorrect (in the empty Java string is different from null) and I returned the vote in favor of your answer, nothing more. If the person who asked did not provide details, ask for these details in the comments before attempting a reply.
– Piovezan