Im在Android 7.0(moto g4)中,我試圖在webview中加載一個url,但它顯示一個空白的白屏screen.It與Android M和下面。當試圖在webview中打開url時,Android 7.0顯示空白屏幕
public class MainActivity extends Activity {
private String webviewURL="http://henmilholidayhomesgoa.com/player2/documentation/EULA.html";
private WebView wv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
wv= (WebView) findViewById(R.id.webview);
wv.getSettings().setTextZoom(60);
wv.getSettings().setBuiltInZoomControls(true);
wv.getSettings().setJavaScriptEnabled(true);
wv.loadUrl(webviewURL);
}
}
注: - 在代碼中提到的網址並非不幸我不能分享:(實際的URL及其與HTTPS URL的,但在後給定的URL實際工作,請讓我知道。如果任何其它的輸入是事先needed.Thanks
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" />
</RelativeLayout>
你打開什麼類型的網址,我的意思是說任何文件或網站或PDF或任何其他媒體類型? –
如果上面的網址可以正常工作,那麼應該使用你想要的網址。 在您的文章中的網址有http嘗試輸入其他網址與https 說:「https://www.google.com」 –
您將需要找到一些URL,可以重現問題,你*可以*把在你的問題。 – CommonsWare