Logout thing

This commit is contained in:
Neslihan 2017-05-16 16:01:29 +03:00
parent cce8c27a66
commit aec4300a2e
4 changed files with 16 additions and 2 deletions

View file

@ -255,8 +255,7 @@ public class CommonsApplication extends Application {
currentAccount = null; currentAccount = null;
} }
public void updateAllDatabases(Context context) public void updateAllDatabases(Context context) {
{
DBOpenHelper dbOpenHelper = DBOpenHelper.getInstance(context); DBOpenHelper dbOpenHelper = DBOpenHelper.getInstance(context);
dbOpenHelper.getReadableDatabase().close(); dbOpenHelper.getReadableDatabase().close();
SQLiteDatabase db = dbOpenHelper.getWritableDatabase(); SQLiteDatabase db = dbOpenHelper.getWritableDatabase();

View file

@ -115,6 +115,11 @@ public class Category {
db.execSQL(CREATE_TABLE_STATEMENT); db.execSQL(CREATE_TABLE_STATEMENT);
} }
public static void onDelete(SQLiteDatabase db) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
onCreate(db);
}
public static void onUpdate(SQLiteDatabase db, int from, int to) { public static void onUpdate(SQLiteDatabase db, int from, int to) {
if(from == to) { if(from == to) {
return; return;

View file

@ -331,6 +331,11 @@ public class Contribution extends Media {
db.execSQL(CREATE_TABLE_STATEMENT); db.execSQL(CREATE_TABLE_STATEMENT);
} }
public static void onDelete(SQLiteDatabase db) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
onCreate(db);
}
public static void onUpdate(SQLiteDatabase db, int from, int to) { public static void onUpdate(SQLiteDatabase db, int from, int to) {
if(from == to) { if(from == to) {
return; return;

View file

@ -142,5 +142,10 @@ public class ModifierSequence {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME); db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
onCreate(db); onCreate(db);
} }
public static void onDelete(SQLiteDatabase db) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
onCreate(db);
}
} }
} }