I'm trying to make an instantApp and put a webView at the opening activity. When I add a url starts with https I can see the website on my webview. but when the url starts with http, I get an error:
net::ERR_CLEARTEXT_NOT_PERMITTED
Here is my code:
public class HelloActivity extends AppCompatActivity {
WebView webView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hello);
webView = (WebView)findViewById(R.id.webView1);
webView.setWebViewClient(new WebViewClient());
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setPluginState(WebSettings.PluginState.ON);
webView.loadUrl("http://www.foxnews.com/");
// webView.loadUrl("https://www.google.com"); this url is working
}
}
Hope you can help me with that.
With reference to android Instant-App Document
All the network traffic from inside instant apps must use HTTPS
. Instant apps does not support HTTP
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With