Hi i want to change/alter value of a string inside a json object which inside a JSONArray and which is from a file stored in internal storage.
My initial thoughts are to convert the object to a string do a find a replace and convert back to JSONObject
search the JSONArray
for the JSONObject remove the old one and put the new one in. Then save the array as a .JSON File to internal storage (will this replace the file thats already there or will it create another file with the same name?).
This is my initial thoughts on how to do this but is this the correct way or is there easier more efficient way to do this?
First, you need to retrieve the required JSON Object form the JSON Array.
You can update the key-value pair of your JSON Object directly by using
mJsonObj.put("<key>", <value>)
.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments