2

I want to load a web page in my webView.

Tried placing the webView.loadurl("") in AsyncTask's doinbackground / onpostexecute and in the onresume.

The url is correct but nothing happens it just shows a white page. In the android manifest file internet access is enabled.

What else needs to be done to load a webview? The application does not crash or show any error. In my emulator I set the proxy with my user name and password.

Here is the code I use to load the URL:

webView = (WebView) findViewById(R.id.webView1); webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient(new WebViewClientSubClass()); webView.loadUrl(promoURL); 
3
  • webView = (WebView) findViewById(R.id.webView1);webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient(new WebViewClientSubClass());webView.loadUrl(promoURL); Commented Oct 1, 2012 at 6:28
  • promourl contains the string url Commented Oct 1, 2012 at 6:29
  • is the promo url like String promourl = "www.something.com"; Commented Oct 1, 2012 at 6:43

2 Answers 2

1

I would recommend you to check what callbacks your webViewClient is getting. I'm guessing that the site requests an authentication, so override onReceivedHttpAuthRequest and do something like this

@Override public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) { Log.d(TAG, "onReceivedHttpAuthRequest")); handler.proceed(username, password); } 

Or if the authentication isn't the problem you can always overide onReceivedSslError to see if there is some certificate problem.

As the initial step though, I would recommend you to use the browser to see if you can load the page. I'm having some trouble with an https site that requires authentication, I enter my credentials and the site can't load(this is on android 2.3)

Sign up to request clarification or add additional context in comments.

Comments

1
myVideoView = (WebView) findViewById(R.id.webView1); myVideoView.setWebViewClient(new WebViewClientSubClass()); myVideoView.getSettings().setJavaScriptEnabled(true); myVideoView.setPersistentDrawingCache(0); myVideoView.getSettings().setPluginsEnabled(true); myVideoView.requestFocus(View.FOCUS_DOWN); myVideoView.loadUrl(promoUrl); 

try this should work and also check whether it opens with https in normal browser.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.