I am using the following method to validate if user has given any input or left an EditTextEditText
empty,. I am concerned about the returnreturn
statement in particular, because my IDE keeps complaining about it.
The return type of the method is voidvoid
, because I dontdon't want any return from this, I only want to stop execution if validation fails. However my IDE complains about the last return statement in the last if-else construct. I am wondering if I should infactin fact change the return type from voidvoid
to booleanboolean
and maintain an array value for each form field. Later on I can check if all the array values are true or not.
The above function gets called on Submit
Submit button and is further processed to the server.