Defining size to a custom array type in Android Kotlin
<p>How to define size for any custom component based array like <strong>ImageView</strong>?</p>

<p>I've tried the following code with a type mismatch error,</p>

<pre><code>    private var dots: Array&lt;ImageView&gt;? = null
    dots = arrayOfNulls&lt;ImageView&gt;(size)
</code></pre>

<p>Here's the actual Java code,</p>

<pre><code>private ImageView[] dots;
dots = new ImageView[dotsCount];
</code></pre>