I have the following method in java and works well in my code. But I just want to rewrite my activity to kotlin. My java methods:
private void testFunction() {
ImageView[] pics;
int count = 6;
pics = new ImageView[count];
}
By converting it automatically with Android studio the following fun is produced but with error:
private fun testFunction() {
val pics: Array<ImageView>
val count = 6
pics = arrayOfNulls(count)
}
How can I archive the same result?
Error
