So I read a json api and get the results. Based on the results I want android to execute two different things.
If status = no then I want one event and if status = yes I want another event.
My code is here:
JSONObject json = new JSONObject(result);
String status = json.getString("status");
Log.d("BeforeIf", status);
if(status == "no"){
//toast logIN failed
Log.d("logIN-no", status);
String message = "Log In Failed";
Toast.makeText(c, message, Toast.LENGTH_SHORT).show();
}
else{
//get userName
Log.d("logIN-yes", "correct");
//get user ID
//set preferences
//launch normal activity
}
The odd part is before the if my log shows status = no but based on the log it seems it go to the else...
06-21 22:24:05.822: D/BeforeIf(26889): no
06-21 22:24:05.877: D/logIN-yes(26889): correct
Based on this run it should not be in the else part of the if statement...what am I missing lol