title: Android number picker using steps
body: <p>I have managed to create a number picker that loops through 5 to 60 in increments of 5. My only problem is that when I get to 60, the application crashes. </p>
  
  <pre><code>//Number pickers
          int minValue = 5;
          int maxValue = 60;
          int step = 5;
  
          String[] numberValues = new String[maxValue/minValue];
  
          for (int i = minValue; i &lt;= maxValue; i+= step)
          {
              numberValues[(i/step)-1] = String.valueOf(i);
          }
  
          mNumberPicker = (NumberPicker)findViewById(R.id.numberPicker);
  
          mNumberPicker.setMinValue(0);
          mNumberPicker.setMaxValue(60);
  
          //mNumberPicker.setValue(20);
          mNumberPicker.setWrapSelectorWheel(false);
          mNumberPicker.setDisplayedValues(numberValues);
  </code></pre>
  
  <p>There is also an error message in the logcat</p>
  
  <blockquote>
    <p>java.lang.ArrayIndexOutOfBoundsException: length=12; index=12</p>
  </blockquote>
  
  <p>I don't understand why as the number has been created successfully so why does the number picker crash when it's chosen?</p>