android sqlitehelper execsql()创建多个表失败
第二个表没创建,真机运行涉及到第二个表就强退,怎么解决,求大神
public class DiaryHelper extends SQLiteOpenHelper {
public DiaryHelper(Context context) {
super(context, "DB_Diary", null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table diary("
+ "_id integer primary key autoincrement,"
+ "title text,"
+ "context text,"
+ "time text)");
db.execSQL("create table media("
+ "_id integer primary key autoincrement,"
+ "title text,"
+ "filePath text,"
+ "date text)");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
//db.execSQL("ALTER TABLE person ADD COLUMN other STRING");
}
}