Hi Stephan,
I'm using the
JSON Library. I feel the problem was that the, inside the new JSONArray
was being considered as an object and not as a String (Hence the error message "JSONArray initial value should be a string or collection or array"). So when I added .toString() at the end, the code is working.
Not sure if it's a correct hypothesis, but please do correct me if I am wrong.