1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-17 02:44:04 +02:00

Pebble: webview ensure the webview works no matter which the order of loading the components is.

This commit is contained in:
Daniele Gobbetti 2017-01-02 12:32:52 +01:00
parent 7ab74fb11b
commit 0efacfbad5

View File

@ -74,6 +74,11 @@ public class WebViewSingleton extends Activity {
webSettings.setDomStorageEnabled(true);
//needed for localstorage
webSettings.setDatabaseEnabled(true);
if (jsInterface != null) {
LOG.debug("Attaching the existing jsInterface to the new webview instance");
instance.addJavascriptInterface(jsInterface, "GBjs");
instance.loadUrl("file:///android_asset/app_config/configure.html");
}
}
});
}
@ -95,7 +100,7 @@ public class WebViewSingleton extends Activity {
}
});
} else {
LOG.debug("Not reloading the webview " + jsInterface.mUuid.toString());
LOG.debug("Not replacing the JS in the webview. JS uuid " + jsInterface.mUuid.toString());
}
return instance;
@ -192,7 +197,7 @@ public class WebViewSingleton extends Activity {
GBDevice device;
public JSInterface(GBDevice device, UUID mUuid) {
LOG.debug("Creating JS interface");
LOG.debug("Creating JS interface for UUID: " + mUuid.toString());
this.device = device;
this.mUuid = mUuid;
}