Converting from JSONArray to String then back again

I need to store a JSONArray object as a string then retrieve the string and convert it back to a JSONArray.

If I do:

JSONArray jArray; String s = jArray.toString() JSONArray newJArray = new JSONArray(s); 

Will I get back the same object?

I'm trying to store a JSONArray in a SQLite database.

Here's what I'm looking at. ()

1

1 Answer

As long as it's a valid JSONArray to begin with, then yes.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like