This question already has an answer here:
- How do I compare strings in Java? 23 answers
The result of "status" is "ok" but it doesn't seem like this in if statement. The value of "result" is "default". What the hell o.O
post_data = new JSONObject(responseText);
System.out.println("status: " + post_data.getString("status"));
if (post_data.getString("status") == "ok") {
System.out.println("if: ok");
result = post_data.getString("url");
} else {
result = "default";
}
Aucun commentaire:
Enregistrer un commentaire