Here is my code. When I run this I get an error saying :
java.lang.ArrayIndexOutOfBoundsException: index=6 length=6
for(i=1;i<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);
}
}
Can anyone help me with this?
Thank You.
replace
for(i=1;i<6;i++)withfor(i=0;i<5;i++)