diogojme diogojme - 1 year ago 55
Android Question

Size of the list does not match the ones it has

I have a list with 20 elements, but it contains a null value at the 15 position, how can I remove the null value from an

List
?

Answer Source

I use the solution from @Lithium after some days researching

tourists.removeAll(Collections.singleton(null));

This code remove all null values from an list.