我在Android studio中使用WebView创建了一个网络应用。我在Android WebView中加载了一个WordPress网站。当我在chrome浏览器上加载它时,WordPress网站在点击按钮时输出一个pdf报告。
该网站在chrome中加载
When i click on PDF button shows the window
和 finally it starts downloading the pdf file
和 the generated pdf report looks like:
But the problem occurs when i use the Android App created in WebView. When i click on PDF button it does nothing 和 i get a Debug log
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: true
[InputMethodManagerWrapper.java:68] hideSoftInputFromWindow
我将清单权限设置为
uses-permission android:name="android.permission.INTERNET"
这里的代码
private static final String WEB_URL = "http://workmanager.midzonetechnologies.com/";
webView = findViewById(R.id.webView);
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setAllowContentAccess(true);
webView.getSettings().setDatabaseEnabled(true);
webView.getSettings().setAllowFileAccessFromFileURLs(true);
webView.getSettings().setAllowUniversalAccessFromFileURLs(true);
webView.getSettings().setBlockNetworkLoads(false);
webView.getSettings().setAppCacheMaxSize( 10 * 1024 * 1024 ); // 10MB
webView.getSettings().setAppCachePath(getApplicationContext().getCacheDir().getAbsolutePath() );
webView.getSettings().setAllowFileAccess( true );
webView.getSettings().setAppCacheEnabled( true );
webView.getSettings().setJavaScriptEnabled( true );
webView.getSettings().setCacheMode( WebSettings.LOAD_DEFAULT );
webView.setWebViewClient(new WebViewClient());
webView.setWebChromeClient(new WebChromeClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(WEB_URL);
请告诉我这个问题是与清单文件权限还是运行时间权限有关,请给个解决方案。
我在WebView中创建的Android应用程序。