The purpose of the code is to print the names of the chapters when the season is in the same position, here an example,
tengo una serie "x" con 2 temporadas
Temporada 1 [10 capitulos] Temporada 2 [10 capitulos}]
serie "e" con 1 temporada
Temporada 1 [8 capitulos]
Y se tiene que mostrar de la siguiente manera en un listview
Serie x
Temporada 1
-----> Capitulo 1
----->Capitulo 2
-----> etc
Temporada 2
-----> Capitulo 1
----->Capitulo 2
-----> etc
And this I do correctly, the problem is in season 1, it shows also the episodes of season 1 of the series "e", someone knows what is due?
My codes WITH THIS FULL A HASHMPAP WITH A CUSTOM ADAPTER OF ARRAYLIST
for (int j = 0; j < resultadosURL.length(); j++) {
JSONObject json_dataURL = resultadosURL.getJSONObject(j);
nombres_capitulos.add(json_dataURL.getString("nombre"));
url.add(json_dataURL.getString("url"));
temporada.add(json_dataURL.getInt("temporada"));
}
nombresCapitulos.put(json_data.getString("titulo"), new SerieTemp(nombres_capitulos, temporada, url));
}
WITH THIS ACCESS THROUGH KEY
nombresCapitulos.get(url_img.keySet().toArray()[position].toString())
AND HERE I SHOW ESE KEY'S RESULTS
for (int i = 1; i <= UtilActividad.getSerie().getTEMPORADAS(); i++){
child = new ArrayList<>();
for (int j = 0; j < UtilActividad.getSerie().getNombresCapitulos().getNombres_capitulos().size(); j++){
if(UtilActividad.getSerie().getNombresCapitulos().getTemporada().get(j) == i){
child.add(UtilActividad.getSerie().getNombresCapitulos().getNombres_capitulos().get(j));
}
}
childItems.add(child);
But I print the results of everything regardless of the keys