0
我已創建SQLite中一個表給我java.lang.ArrayIndexOutOfBoundsException 這裏是代碼:java.lang.ArrayIndexOutOfBoundsException
db.execSQL("CREATE TABLE "+scoreboardTable+" ("+scoreboard_id+ " INTEGER PRIMARY KEY NOT NULL,"+" FOREIGN KEY ("+player_fk+ ") REFERENCES "+playerTable+" ("+playerid+ "), "
+"FOREIGN KEY ("+ Template_fk+ ") REFERENCES " +TemplateTable+" ("+ templateid+ "),"+ total_flick+"int"+surprise_success+"varchar"+surprise_failure+"varchar)");
}
和
public void Insert_scoreboard(String[] str)
{
try
{
SQLiteDatabase DB= this.getWritableDatabase();
ContentValues cv=new ContentValues();
cv.put("scoreboard_id", str[0]);
cv.put("player_fk", str[1]);
cv.put("Template_fk", str[2]);
cv.put("total_flick", str[3]);
cv.put("surprise_success", str[4]);
cv.put("surprise_failure", str[5]);
DB.insert(scoreboardTable , "scoreboard", cv);
DB.close();
}
catch(Exception ex)
{
ex.toString();
}
如果我做錯了。