This question already has an answer here:
- Check if EditText is empty. [closed] 30 answers
In my app, I have around 5 editText boxes in every screen.I want to check if they are empty or not and if all the text boxes are not empty, then there is an intent which takes you to the next screen. I want to know what code to write.
Just add this code in your java file when you want to call the intent.
Here, just replace the
your_editTextBox1_id
with theID
you set in yourxml
file.If you want to check it when a
Button
is clicked, just add this code in theOnClick
method of the button.