I am trying to creating two table with sql lite but the apps keep crashing.
Below is my code
public void onCreate(SQLiteDatabase database) {
String queryUser_Details = "CREATE TABLE user_details ( user_Id INTEGER PRIMARY KEY, name TEXT, " +
"gender TEXT, hairColor TEXT, weight TEXT, height TEXT, age TEXT, comment TEXT)";
database.execSQL(queryUser_Details);
String queryUser_Activity =
"CREATE TABLE user_activity ( detail_Id INTEGER PRIMARY KEY, time TEXT, location TEXT, note TEXT, FOREIGN KEY(user_Id) REFERENCES user_details(user_Id))";
database.execSQL(queryUser_Activity);
}
Aucun commentaire:
Enregistrer un commentaire