我有移动网站360 Image的链接,但我想在我的应用程序中加载WebView。 Link在本机移动浏览器和Google Chrome上完美运行,但在我的应用程序中不在WebView中。
任何帮助都是赞赏的。 感谢。
答案 0 :(得分:0)
最近,但我认为这将对某人有所帮助。在使用webview进行活动时,请在androidmanifests set中设置此值:android:hardwareAccelerated="true"
和我的webview如下:
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setPluginState(WebSettings.PluginState.ON);
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setAllowContentAccess(true);
webView.getSettings().setLoadsImagesAutomatically(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
webView.getSettings().setAllowFileAccessFromFileURLs(true);
}
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webView.setWebChromeClient(new WebChromeClient());
尝试一下,它将完美运行!
答案 1 :(得分:0)
我已经实现了Google VR库,因为我发现它在WebView中不可行。
//VR
compile 'com.google.vr:sdk-audio:1.10.0'
compile 'com.google.vr:sdk-base:1.10.0'
compile 'com.google.vr:sdk-common:1.10.0'
compile 'com.google.vr:sdk-commonwidget:1.10.0'
compile 'com.google.vr:sdk-panowidget:1.10.0'
compile 'com.google.vr:sdk-videowidget:1.10.0'