mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-11 00:00:05 +08:00
Use the same database based upon application context for each html page loaded as part of this app.
This commit is contained in:
@@ -235,9 +235,9 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
|
settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
|
||||||
|
|
||||||
// Enable database
|
// Enable database
|
||||||
Package pack = this.getClass().getPackage();
|
settings.setDatabaseEnabled(true);
|
||||||
String appPackage = pack.getName();
|
String databasePath = this.getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
|
||||||
WebViewReflect.setStorage(settings, true, "/data/data/" + appPackage + "/app_database/");
|
settings.setDatabasePath(databasePath);
|
||||||
|
|
||||||
// Enable DOM storage
|
// Enable DOM storage
|
||||||
WebViewReflect.setDomStorage(settings);
|
WebViewReflect.setDomStorage(settings);
|
||||||
|
|||||||
Reference in New Issue
Block a user