Questions tagged [webviewclient]

An Android class to intercept load requests, key events, and other events.

An Android class that is attached to a Webkit Webview to intercept load requests, key events, and other events.

Documentation: https://developer.android.com/reference/android/webkit/WebViewClient.html

321 questions
3
votes
1 answer

Android WebView Communicating from a WebViewClient to Activity

I have a simple helloworld app. I am trying to tell the Activity that a user clicked, "Cnn.com" WebViewClient wc = new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if…
Ian Vink
  • 66,960
  • 104
  • 341
  • 555
3
votes
1 answer

How to Implement / Link Run Keeper API in Android using Eclipse?

I want to use run keeper API in my Code as I am developing Application which will track walking distance etc . This can be done by using Run Keeper API. During registering my app, it ask me to enter post call back URL , I don't know from where…
Fahad Nazir
  • 33
  • 1
  • 5
3
votes
2 answers

Check if certain url is finished loading, then open another one in WebView

I want to check if certain URL is finished loading, and then load another URL and if that new url is finished loading do something, how? I know how to check if certain URL is finished loading like this: webView.setWebViewClient(new WebViewClient()…
Amar Kalabić
  • 888
  • 4
  • 15
  • 33
3
votes
2 answers

Delay before the redirect page

There is a link which is 5 seconds redirects to another page, how can I make a delay before the redirect Here's an example link:…
madcrinkle
  • 71
  • 7
3
votes
1 answer

Android : WebView onPageFinished not calling after shouldOverrideUrlLoading method in android 4.4

I am working on WebView android 4.4 when URL redirect happens loading wheel keep on loading its not dismiss properly. I googled lot but I'm not getting. Can any one explain what is the flow of the WebView android 4.4. Here is my code what I tried :…
Aristo Michael
  • 2,166
  • 3
  • 35
  • 43
3
votes
0 answers

How to have Android webview open links that are target “_blank” in default browser

How to have Android webview open links that are target “_blank” in default browser , i tried the following code but it still show all links with the webview , any one have a solution ? public boolean shouldOverrideUrlLoading(WebView view, String…
Dr.Mezo
  • 807
  • 3
  • 10
  • 25
3
votes
1 answer

WebView goback() reloads last page

Here is xml code of main activity..
Ronak
  • 165
  • 1
  • 3
  • 15
3
votes
1 answer

java.lang.IllegalStateException: CookieSyncManager::createInstance() needs to be called before CookieSyncManager::getInstance()

I am trying to get cookies in webview on shouldOverrideUrlLoading() method and i got this error. Please have a look at my code below, WebViewClient loginClient = new WebViewClient() { @Override public boolean…
Sivakumar S
  • 681
  • 5
  • 19
3
votes
0 answers

url is decoded in WebViewClient.shouldOverrideUrlLoading(WebView view, String url)

I have the following example: private WebView wv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); wv = (WebView)…
3
votes
1 answer

How to start another activity from webChromeClient

In webViewClient I use shouldOverrideUrlLoading to check a link/url and load another activity but how can I do the same trick in webChromeClient?
Harry
  • 786
  • 1
  • 8
  • 27
3
votes
1 answer

Detecting when Android Cordova webview finishes loading

Surprisingly hard to find good insight into this, but I need to detect when the Cordova webview has finished loading so that I can run some initialization code on the native side. This code makes callbacks to the webview's javascript so the…
Josh Lehman
  • 278
  • 5
  • 14
3
votes
2 answers

How to handle errors inside webview?

I want to load a webpage. private class MyJavaScriptInterface { private MyJavaScriptInterface () { } public void setHtml(String contentHtml) { if (contentHtml != null && contentHtml.trim().length() > 0) { //Do…
Devu Soman
  • 2,246
  • 13
  • 36
  • 57
3
votes
0 answers

How to troubleshoot root cause of ERROR_IO (-7) in onReceivedError

My WebView based code is too long (and scattered across several modules) to post here, and I am looking for a general technique that may be helpful to others anyway, so here goes: I have a set of WebView, WebViewClient and JavascriptInterface…
3
votes
1 answer

Android Webview not detecting link click while Javascript is enabled in webview

In my application I need to detect the link click inside the webview. I use the following code web = (WebView)findViewById(R.id.webView1); web.getSettings().setJavaScriptEnabled(true); web.setWebViewClient(new…
Santanu
  • 141
  • 2
  • 11
3
votes
0 answers

Android WebView with WebViewClient - authentication with onReceivedHttpAuthRequest

In my application, I use WebView with WebViewClient, with overriden method onReceivedHttpAuthRequest, where I prompt user to enter his credentials, using AlertDialog. When credentials are entered, I call handler.proceed(username, password); My…
Berťák
  • 7,143
  • 2
  • 29
  • 38