I am trying to use localstorage from my local web APP, here is part of the initialization of WebView:
static class MyWebView extends WebView { public MyWebView(Context context) { super(context); this.getSettings().setJavaScriptEnabled(true);
and here is a test application in JavaScript:
function testStorage() { var storage = window.localStorage; if (storage) { try { storage.setItem("name", "Hello World!");
but the problem is that localStorage is always null, I checked permissions and created WebChromeClient with
@Override public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize, long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater) { quotaUpdater.updateQuota(estimatedSize * 2); }
which is never called. Does anyone know why?
thanks
source share