mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +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:
parent
24bb836221
commit
017fa1b917
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user