android - if condition of string and editText -


i'm newbie in android programming. , i'm being confused of error in line saying, "incompatible operand types edittext , string"

the usertype variable spinner while user variable edittext

if((usertype.getselecteditem()=="administrator")&(user=="1500110001")) {     login();   } 

hope newbie here. thank in advance!

change usertype.getselecteditem() usertype.getselecteditem().gettext() , compare strings equals(), , change & && (for reasons mentioned @nicholassimon), this

if(usertype.getselecteditem().gettext().equals("administrator") && (user.equals("1500110001")) 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -