I want to get an json object from this string coming from this JSON file:
{
"categories": {
"category": [
{
"label": "Collaboration",
"thumbnail": "http://mywebite.com/dfsv",
"description": "...",
"contents": {
"@attributes": {
"count": "79"
}
},
"@attributes": {
"id": "ZSQYN2"
}
},
{
"label": "Communication",
"thumbnail": "http://mywebite.com/dfsv",
"description": "...",
"contents": {
"@attributes": {
"count": "43"
}
},
"@attributes": {
"id": "uGQ9MC"
}
}
],
"@attributes": {
"page": "12",
"limit": "0",
"count": "111",
"lang": "en"
}
}
}
I'm using this code :
JSONObject obj = new JSONObject(myString);
And I got this error message:
Value ... of type org.json.JSONArray cannot be converted to JSONObject
And if I do :
JSONArray obj = new JSONArray(myString);
I got this error message:
Value ... of type org.json.JSONObject cannot be converted to JSONArray
...
Do you have any idea ?