I have a JSONObject:
try {
JSONObject myJsonObject = new JSONObject("{ \"options\": [\"Oui\", \"Non\"] }");
JSONArray myJsonArray = myJsonObject.getJSONArray("options");
} catch (Exception e) {
e.printStackTrace();
}
myJsonArray.toString() contain:
["Yes", "No"]
I need to convert it to a JSONObject like this:
{ "0": "Yes", "1": "No" }
and also to:
{ "Yes": "Yes", "No": "No" }
Any idea how I can do this?