开发者

Converting from JSONArray to String then back again

开发者 https://www.devze.com 2023-03-06 00:53 出处:网络
I need to store a JSONArray object as a string then retrieve the string and convert it back to a JSONArray.

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

If开发者_StackOverflow社区 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. http://developer.android.com/reference/org/json/JSONArray.html#toString()


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

0

精彩评论

暂无评论...
验证码 换一张
取 消