I try to create a hybrid Worklight app to aggregate multiple external Portal pages. There is a tab bar and each view in the tab bar loads its own WebView to display a different Portal page. This works fine and I have everything running but Worklight does not load in the Webviews. I want to access Cordova features like the camera inside the Portal pages.
Worklight initializes fine when I load a Portal page directly in the master Webview, but it does not load in an embedded Webview, i.e. all necessary Worklight files are there and the Portal page is set up right.
I enhanced this example:
http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v506/09_06_Integrating_server_generated_pages_in_Worklight_applications.pdf
This is the important part of the code:
webViewOverlay = new WebView(this);
webViewOverlay.setWebViewClient(webViewClient);
webViewOverlay.setWebChromeClient(new WebChromeClient());
webViewOverlay.getSettings().setJavaScriptEnabled(true);
webViewOverlay.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webViewOverlay.clearCache(true);
webViewOverlay.loadData(""http://mymielke.de/test/portal/test.html"", "text/html", "UTF-8");