解決方法:
//xml
<WebView
android:id="@+id/wv"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</WebView>
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about_new_version);
ButterKnife.bind(this);
WebView wv = findViewById(R.id.wv);
//對webview的修復
wv.setWebViewClient(new WebViewClient(){
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
wv.getSettings()
.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}
}
});
}