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

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -