Error parsing data org.json.JSONException: Expected ':' after n in Android or Android Studio

Last time, i got error when trying to parse a JSONObject , then i have found simple mistake during parsing.

It's because i append an "n" at the end of each line here:

        while((line = reader.readLine()) != null) {
            sb.append(line + "n");
        }

then I change to a newline character "\n":

    while((line = reader.readLine()) != null) {
        sb.append(line + "\n");
    }

finally, I solve the problem, hope this may helpful.

Happy Coding !!!
Error parsing data org.json.JSONException: Expected ':' after n in Android or Android Studio Error parsing data org.json.JSONException: Expected ':' after n in Android or Android Studio Reviewed by D Kshetri on 3:57 PM Rating: 5

No comments:

Powered by Blogger.