• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

EditText conditional problem

alavro_

Lurker
So i have a EditText field, which i want to, check if the age is above and under my limits.

if (Integer.parseInt(age.getText().toString()) < 18 && Integer.parseInt(age.getText().toString()) >= 0)
But also, i want to simply check if the field is empty, for what i used.

else if (age.getText().toString().isEmpty())

Unluckly this one is not working, i think it sort of get in to conflict with the first one or something, because i tried with just one condition of both, and it works..
I also tried to store in String variable the method to check isEmpty(), and also in int one, to do the age comparation, but it still not working.

Thanks in advance.
 
Back
Top Bottom