Ok, so I have something like:
CharSequence[] lines;
and then I want to set its size in an Android Dialog click, like:
lines = new CharSequence[131];
but it will end up empty.
I need to populate a dialog with its values, but if I would do something like:
CharSequence[] lines = new CharSequence[131];
in the beginning and then populating it, then I will get an error when scrolling because of the null options in the dialog (no of options < 131).
I am kind of a beginner in Java. Any help would be appreciated.
Two options:
lines[i] != null
lines
with data using Arrays.fill(lines, new CharSequence()
) see the doc