Good day. I have problem with creating Arraylist. When Im using "IF Condition: for adding objects in array list, i can only call first object, even when array list has size above 20. If Im adding objects without If condition everything is working proper. Please see part of mentioned code.
This is my first post here. Please for advice.
ArrayList<String> listawynikow = new ArrayList<String>(gh2.length);
for(i=0; i<gh2.length;i++) {
if (gh2[i].matches("[0-9]+"))
listawynikow.add(gh2[i]);}
StringBuilder sb2 = new StringBuilder();
for (int j = 0; j<listawynikow.size(); j++){
sb2.append(listawynikow.get(j)).append(";").append("\n");}
String wyniki1 = sb2.toString();
String[] WYNIKI = wyniki1.split(";");
This is alarm what im Recaiving. Caused by: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
Aucun commentaire:
Enregistrer un commentaire