Commit d58751bf authored by Daniel Wolf's avatar Daniel Wolf

sqlite_sequence may not be dropped

parent 37ba782f
......@@ -48,7 +48,7 @@ public class DatabaseHelper extends com.frostnerd.utils.database.DatabaseHelper
private MockedContext wrappedContext;
public static DatabaseHelper getInstance(@NonNull Context context){
return instance == null ? instance = new DatabaseHelper(mock(context)) : instance;
return instance == null ? instance = new DatabaseHelper(context.getApplicationContext() != null ? context.getApplicationContext() : context) : instance;
}
public static boolean instanceActive(){
......@@ -108,6 +108,7 @@ public class DatabaseHelper extends com.frostnerd.utils.database.DatabaseHelper
cursor.close();
}
for(String s: getTableNames(db)){
if(!s.equalsIgnoreCase("sqlite_sequence"))
db.execSQL("DROP TABLE IF EXISTS " + s);
}
onCreate(db);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment