使用WIFI時,我的WebView加載,我上加載它在這兩個Android模擬器和設備(使用3G)的URL加載URL後空白/白頁。Web視圖顯示的Android
當我加載相同的網頁帶有WiFi它返回一個空白/白頁。
mWebView = (WebView) mRootView.findViewById(R.id.webView);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setRenderPriority(RenderPriority.HIGH);
mWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
mWebView.setWebViewClient(new WebViewClient()
@Override
public void onPageFinished(WebView view, String url) {
Log.d(TAG, "Finished loading URL: " + url);
}
@Override
public void onReceivedError(WebView view, int errorCode,
String description, String failingUrl) {
Log.d("ON RECEIVE ERROR", failingUrl + " --- " + description);
} })
mWebView.invalidate();
mWebView.loadUrl(Url);
而且我做了任何更改/在清單中添加了一些東西。
這是我的清單文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tfe"
android:versionCode="3"
android:versionName="0.0.3" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission
android:name="com.xxx.gcm.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.xxx.gcm.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:name=".application.SampleApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/AppTheme" >
<activity
android:name=".HomeActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</application>
</manifest>
告訴我你的manifest.xml文件和代碼 –
@簡單的計劃:請看看我添加的代碼,並幫助我 – ydnas
需要實現'webViewclient shouldOverrideUrlLoading(... ..)'方法 –