[["a","b","c","0","0","3","1","1","1","1","1","1"],["a","b","c","1","5","5","1","1","1","1","1","1"]]
Is the data in JSON format right? It's not about height or price I'm going to parse on Android type org.json.JSONArray cannot be converted to JSONObject I'm getting this error
android java
Exactly JSON array (JSONarray
). And the error statement means, "I don't convert JSON arrays to JSON objects (JSONObject
).
I think you need to understand JSONARRAY and JSONObject types.
JSONARRAY is identified by default as [ ] and can have elements internally.
[1, 2, 3, 4, 5]
You can do an array of basic data types in this way You can also have an object or an array as an element.
In JSON, the object is identified as {} and consists of a pair of key:value You can have elements.
{ "firstname": "peter", "lastname":"ahn" }
The example you wrote in the body refers to an array that contains an array of strings as elements.
[
["a","b","c","0","0","3","1","1","1","1","1","1"],
["a","b","c","1","5","5","1","1","1","1","1","1"]
]
You'll understand better if you look at it like this, right?
Usually, when converting to JSON, the error is that the type is not correct because it is converted to JSONObject.
549 PHP ssh2_scp_send fails to send files as intended
548 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
725 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
539 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.