I need to be able to show the content of an iframe in my app that contains a webview.
It turns out that I have an app that contains a webview, inside this is a website (up there without problems), the problem arises that within this site there is a button that takes me to a section that is an iframe , but unfortunately when entering this section the webview shows me a blank image and does not reproduce the content, I have made several changes to my code, such as adding permissions, etc.
Here is the code of my WebView.
private void valida_version() {
final WebView webView;
webView = (WebView)findViewById(R.id.webView);
webView.setInitialScale(1);
webView.setWebChromeClient(new WebChromeClient());
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setPluginState(WebSettings.PluginState.ON);
webView.getSettings().setPluginState(WebSettings.PluginState.ON_DEMAND);
webView.setWebViewClient(new WebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
webView.loadUrl("url");
/*myBrowser = (WebView)findViewById(R.id.webView);
myBrowser.setWebViewClient(new WebViewClient());
myBrowser.getSettings().setAllowFileAccessFromFileURLs(true);
myBrowser.getSettings().setJavaScriptEnabled(true);
myBrowser.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
myBrowser.getSettings().setDatabaseEnabled(true);
myBrowser.setWebChromeClient(new WebChromeClient());
myBrowser.loadUrl("http://m.cooperativa.cl");
myBrowser.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
String msgToSend = "x";
// Log.i("llego a onpage","si");
myBrowser.loadUrl("javascript:oldAppMsje.callFromActivity(\"" + msgToSend + "\")");
}
});*/
}
Here's the code of my Manifest
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@drawable/appicon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/ThemeCoop"
android:name="AnalyticsApplication"
android:hardwareAccelerated="true">
<activity
android:name="Splash"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".SinConexion"
android:label="@string/app_name">
</activity>
</application>
Here I show what I can capture from Log cat.
Is it possible that you can help me with a little guidance on what I should do?