title: 2D Array in Kotlin
body: <p>How do you make a 2D Int array in Kotlin? I'm trying to convert this code to Kotlin:</p>
  <pre class="lang-java prettyprint-override"><code>int[][] states = new int[][] {
        new int[]{-android.R.attr.state_pressed}, // not pressed
        new int[] { android.R.attr.state_pressed}  // pressed
  };
  int[] colors = new int[] {
        foregroundColor,
        accentColor,
        accentColor
  };
  ColorStateList myList = new ColorStateList(states, colors);
  </code></pre>
  <p>Here is one attempt I tried, where the first 2D array didn't work, but I got the 1D array to work:</p>
  <pre class="lang-kotlin prettyprint-override"><code>//This doesn't work:
  var states: IntArray = intArrayOf(
      intArrayOf(-android.R.attr.state_pressed), // not pressed
      intArrayOf(android.R.attr.state_pressed)  // pressed
  );
  //This array works:
  var colors: IntArray = intArrayOf(
      foregroundColor,
      accentColor,
      accentColor
  );
  val myList: ColorStateList = ColorStateList(states, colors);
  </code></pre>