收藏前修改,收藏后修改,修改值校验

This commit is contained in:
sonichy
2019-02-11 23:00:01 +08:00
parent eb05d03808
commit ec032b205b
11 changed files with 1055 additions and 888 deletions

View File

@@ -12,7 +12,7 @@ public class DBHelper extends SQLiteOpenHelper {
public static final String DATABASE_NAME = MainActivity.dir + File.separator + "webfav.db";
private final static int VERSION = 1;
String TableName = "webfav";
static String TableName = "webfav";
private SQLiteDatabase db;
private static DBHelper mInstance = null;
@@ -39,10 +39,6 @@ public class DBHelper extends SQLiteOpenHelper {
// onCreate(db);
switch (newVersion) {
case 6:
db.execSQL("alter table battery rename to battery_temp");
db.execSQL("CREATE TABLE battery (_id INTEGER PRIMARY KEY ,time TEXT,level INTEGER, voltage INTEGER, current INTEGER , temperature INTEGER, cpu INTEGER)");
db.execSQL("insert into battery select *,'' from battery_temp");
db.execSQL("drop table battery_temp");
break;
}
}
@@ -77,4 +73,4 @@ public class DBHelper extends SQLiteOpenHelper {
if (db != null)
db.close();
}
}
}