I’m using eclipse to develo[p an Android app. the app sends the user name and password to the php (server side), if the user doesn’t exists it returns “not found”….
for now I don’t want to use json 🙂
my problem is that i can’t do EQUAL to the retur string !!!! it’s not working
if(text=="not found") ShowMessage("Invalid user and password !!");
or
if(text==getResources().getString(R.string.wronguser))
ShowMessage("Invalid user and password !!");
and I tried the .equal(..) function BUT it’s not work….
When I assign the return vale to textview it show me “not found” so why the == OR .equal doesn’t work????
My php using UTF-8 encoding…THANX 🙂
In Java strings should be compared using
.equals. (==performs an identity comparison, while.equalscompares actual content.)So start by changing
to
etc.
If that doesn’t seem to work, make sure the strings doesn’t contain unexpected leading / trailing white-space. You may also want to ignore case: