user3671271
user3671271

Reputation: 568

How to check correctly in server json response?

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

Answers (1)

walkmn
walkmn

Reputation: 2391

If you want check string, do like this:

if (result.contentEquals("\"OKPOST\"")) {
// do something...
}

Upvotes: 1

Related Questions