I receive a JSONObject from server that is as follows:
{
"opOutput":{
"DISPLAY_VALUES":[
"Acceptance",
"Arrive Load Port",
"Arrive Receipt Point",
"Arrive Relay Port",
"Arrive Terminal",
"Arrived at Delivery Location",
"Arrived at Pickup Location",
"Arrived Intermodal Train",
"At Customs",
.
.
.
.
],
"VALUES":[
"ACCPT",
"ALPT",
"ARRP",
"ARREL",
"ATRM",
"QARD",
"ARPUL",
"AIMTRN",
"K",
.
.
.
.
]
},
"_returnValue":{
"TX_TYPE":"SHIPMENT",
"__DeltaStatus":2,
"ORG_CODE":"GFM",
"TX_ID":"11019082"
},
"_returnType":"SUCCESS"
}
Now I need to get the display value for s String s that is equal to one of the values. i.e I have string "ACCPT" and i need to get "Acceptance" from the JSONObject.
I've made two JSONArrays with DISPLAY_VALUES and VALUES with
JSONObject opoutput=shipmentcodes.getJSONObject("opOutput");
JSONArray event_values=opoutput.getJSONArray("DISPLAY_VALUES");
JSONArray event_codes=opoutput.getJSONArray("VALUES");
where shipmentcodes is the original JSONObject, but I'm unsure about how to proceed further. Any tips?