Why tf is "Index": 0 @ index = 1 and "Index": 2 @ index = 0
This commit is contained in:
@@ -127,7 +127,19 @@ private fun decompressGZIPAndDecodeBase64(compressedData: String): String {
|
||||
private fun downloadImagesTask(jsonResponse: JSONObject, mainDir : File) : Int {
|
||||
clearFolder(mainDir)
|
||||
|
||||
val jsonDaysObject = jsonResponse.getJSONArray("ResultMenuItems").getJSONObject(0).getJSONArray("Childs").getJSONObject(0).getJSONObject("Root").getJSONArray("Childs")
|
||||
var jsonDaysObject = jsonResponse.getJSONArray("ResultMenuItems")
|
||||
for (i in 0 until jsonDaysObject.length()) {
|
||||
if (jsonDaysObject.getJSONObject(i).get("Index") == 0) {
|
||||
jsonDaysObject = jsonDaysObject.getJSONObject(i).getJSONArray("Childs")
|
||||
break
|
||||
}
|
||||
}
|
||||
for (i in 0 until jsonDaysObject.length()) {
|
||||
if (jsonDaysObject.getJSONObject(i).get("Index") == 0) {
|
||||
jsonDaysObject = jsonDaysObject.getJSONObject(i).getJSONObject("Root").getJSONArray("Childs")
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
for (d in 0 until jsonDaysObject.length()) {
|
||||
val jsonDayObject = jsonDaysObject.getJSONObject(d)
|
||||
|
||||
Reference in New Issue
Block a user