Reputation: 568
I'm a very beginner in android, I want to write a simple application to check server json returned to my phone,server returns to me this son:
""OKPOST""
I want to write this simple if condition:
if (result==""OKPOST"") do something...
But I get error in if block in double quotation ,how can i solve that?
thanks.
Upvotes: 0
Views: 35
Reputation: 2391
If you want check string, do like this:
if (result.contentEquals("\"OKPOST\"")) {
// do something...
}
Upvotes: 1