is there a way I can initialize my arrays in a loop, without them being of nullable items?
u
is there a way I can initialize my arrays in a loop, without them being of nullable items?
d
val imageViews: Array<TextView?> = Array(quoteContainers.size) { idx -> quoteContainers[idx].findViewById(R.id.imageView) }
as a first quick and dirty implementation. You'd have to repeat it for each array. you're looping through quote containers 3 times, but it's a pretty small list
You'd also have to do a .forEach on container to set the click listeners, too
u
yea thats what I thought, bummer