Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid web view is not loading the URL
    text
    copied!<p>I have a problem on loading webview with the following <a href="http://en.wikipedia.org/wiki/Uniform_resource_locator" rel="nofollow">URLs</a>:</p> <ol> <li><p><a href="http://www.walmart.com/" rel="nofollow">http://www.walmart.com/</a></p></li> <li><p><a href="http://mobile.walmart.com/" rel="nofollow">http://mobile.walmart.com/</a></p></li> </ol> <p>But both are showing an empty page in webview.</p> <p>Here I have attached the source code. How do I come out of this problem?</p> <p>Source:</p> <pre><code>import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.view.Window; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Button; public class WEBVIEW_ITSELF extends Activity { WebView homeWeb; Button btnPlay; final Activity activity = this; static Context mContext; public boolean orandationChange = true; @Override protected void onPause() { super.onPause(); orandationChange = false; } String urlchange; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.getWindow().requestFeature(Window.FEATURE_PROGRESS); setContentView(R.layout.i_webview); mContext = this; homeWeb = (WebView) findViewById(R.id.website_webview); homeWeb.getSettings().setJavaScriptEnabled(true); homeWeb.getSettings().setSupportZoom(true); // Zoom control on web (You) homeWeb.clearHistory(); homeWeb.clearFormData(); homeWeb.clearCache(true); WebSettings webSettings = homeWeb.getSettings(); webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); homeWeb.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { activity.setTitle("Loading..."); activity.setProgress(progress * 100); if (progress == 100) activity.setTitle(R.string.app_name); // To enable this you // should not set // android:theme="@android:style/Theme.Black.NoTitleBar" // in the manifest file. } }); homeWeb.setWebViewClient(new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { System.out.println(" failingUrl " + failingUrl); System.out.println(" description " + description); System.out.println(" errorCode " + errorCode); // Handle the error } @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return false; } }); homeWeb.loadUrl("http://mobile.walmart.com/"); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload