I have a next loop:
arrayI = new POJO_I [response.body().length];
arrayI = response.body();
arrayOfNamesMain = new String[10];
for(int t = 0; t< arrayI.length; t++) {
if (arrayI[t].getMain().equals("1")) {
arrayOfNamesMain[t] = arrayI[t].getName();
}
}
After loop ending, I have arrayOfNamesMain with a few first empty elements, so actually it starts from the 5th index because first positions of arrayI[t] are not in if statement.
What should I do for filling my arrayOfNamesMain from 0 indexes? How can I sort the array and remove empty elements?
arrayItwice?