I have this bit of code:
JSONArray data = object.getJSONArray("Test");
for (int i = 0; i < data.length(); i++)
{
JSONObject dataObject = data.getJSONObject(i);
etc ...
I don't know before run time what I will have in dataObject though. Is it possible to loop through the keys somehow?
I thought this might work, as I saw it mentioned in another Stackoverflow article:
for (String key : dataObject.keys())
But I get an error saying "Can only iterate over an array or an instance of java.lang.Iterable"
Does anyone know how it can be done?