Fondamentalmente ho:Come posso trasformare un JSONArray in un oggetto JSONObject?
JSONArray j = new JSONArray();
j.add(new JSONObject()); //JSONObject has a bunch of data in it
j.add(new JSONArray()); //JSONArray has a bunch of data in it
E ora vorrei trasformare questa JSONArray
in un JSONObject
con le stesse informazioni in esso. In modo che possa passare attorno all'oggetto e poi quando voglio posso estrarre tutte le informazioni dall'oggetto. Qualsiasi aiuto sarebbe apprezzato, grazie.
Beh ho provato ad utilizzare JSONArray.toJSONObject (arg) ma im nuovo a JSON non riuscivo a capire cosa l'API ha voluto mettere dentro per l'arg. http://json-lib.sourceforge.net/apidocs/net/sf/json/JSONArray.html#toJSONObject(net.sf.json.JSONArray) – Grammin