Skip to content

armgit / haven

Public Imported from GitHub
0

Haven is for people who need a way to protect their personal spaces and possessions without compromising their own privacy, through an Android app and on-device sensors

Fix "no such table" bug.

fattire802930a5d422
diff --git a/src/main/java/org/havenapp/main/HavenApp.java b/src/main/java/org/havenapp/main/HavenApp.java
index 69ae819..439c097 100644
--- a/src/main/java/org/havenapp/main/HavenApp.java
+++ b/src/main/java/org/havenapp/main/HavenApp.java
@@ -25,7 +25,9 @@ import android.util.Log;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.core.ImagePipelineConfig;
import com.facebook.imagepipeline.decoder.SimpleProgressiveJpegConfig;
+import com.orm.SchemaGenerator;
import com.orm.SugarContext;
+import com.orm.SugarDb;
import java.io.IOException;
@@ -46,7 +48,10 @@ public class HavenApp extends MultiDexApplication {
public void onCreate() {
super.onCreate();
- SugarContext.init(this);
+ SugarContext.init(getApplicationContext());
+
+ SchemaGenerator schemaGenerator = new SchemaGenerator(this);
+ schemaGenerator.createDatabase(new SugarDb(this).getDB());
mPrefs = new PreferenceManager(this);