title: Android ArrayIndexOutOfBoundsException
body: <p>Here is my code. When I run this I get an error saying :</p>
  
  <blockquote>
    <p>java.lang.ArrayIndexOutOfBoundsException: index=6 length=6 </p>
  </blockquote>
  
  <pre><code>for(i=1;i&lt;6;i++)
  
  {
     String s = getSharedPreferences("TEXT", 0).getString("DATA" + sequenceNumber, null);
  
  
                      if(s!=null){
                              String[] numb= new String[6];
                              numb[i]=s;
                              Bundle b=new Bundle();
                              b.putStringArray(key, numb);
                              Intent i=new Intent();
                              i.putExtras(b);
                              i.setClass(MainActivity.this, NotifyEmergencyCall.class);
                              startActivity(i);
                              }
  
  }
  </code></pre>
  
  <p>Can anyone help me with this?
  Thank You.</p>