Home > Mobile >  Android development: Java. Lang. ArrayIndexOutOfBoundsException: length=3; The index=4
Android development: Java. Lang. ArrayIndexOutOfBoundsException: length=3; The index=4

Time:10-20

Private void infoss () {
C=final Calendar Calendar. GetInstance ();//get the current system date
Be sad et chtistina georgina rossetti.british poetess int mYear=(Calendar YEAR);//get the year
Be sad et chtistina georgina rossetti.british poetess int mMonth=(. Calendar MONTH);//get in
Be sad et chtistina georgina rossetti.british poetess int mDay=(Calendar. DAY_OF_MONTH);//get days

//updateDisplay ();//display the current system time
Double [] str_monryInfos=new double [50];//define a string array, used to store spending information
String [] str_timeInfos=new String [50].
OutaccountDAO outinfo=new OutaccountDAO (Outaccountinfo. This);//create OutaccountDAO object
//get all information, and stored in the List of generic collection
List//strmonryInfos=new double [listoutinfos. The size ()];//set the length of the string array
//strtimeInfos=new String [listoutinfos. The size ()];
int i=0;//define a start mark
For (Tb_outaccount Tb_outaccount: listoutinfos) {//traverse the List of generic collections
//synthesize spending related block a string, stored in a string array of the corresponding position
Str_monryInfos. [I]=tb_outaccount getMoney ();
Str_timeInfos. [I]=tb_outaccount getTime ();
i++;//id 1
}
Int [] strmonth=new int [50].
Int [] strday=new int [50].
for(int j=0; JSTR=str_timeInfos String [] [j]. The split (" - ");
For (int m=0; M<3; M++) {
Int a=Integer. ParseInt (STR [I]);
If (m==1) {
Strmonth [j]=a;
}
If (m==2) {
Strday [j]=a;
}
}
}
Double sum_month=0;
For (int s=0; sIf (mMonth==strmonth [s]) {
Sum_month=sum_month + str_monryInfos [s].
}
}
If (sum_month==500) {
Send (" 5554 ", "your online spending has reached 500 yuan for the month");
}
Double sum_day=0;
For (int s=0; sIf (mDay==strmonth [s]) {
Sum_day=sum_day + str_monryInfos [s].
}
}
If (sum_day==50) {
Send (" 5554 ", "on the day of your online spending has reached 50 yuan");
}

CodePudding user response:

An array of see scope of that piece of code you have any question
  • Related