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

WebViewClient class does not gets instantiated in android 3.1

Facing a problem when specified url gets redirected to another one. I have implemented webviewclient for my webview. The webviewclient class gets called for android 2.3 and below, but wont for android 3.1. Below is my code. protected void…
2
votes
3 answers

E/DroidGap(21383): DroidGap: TIMEOUT ERROR! - calling webViewClient

I use phonegap 1.3.0 to develop mobile application. when i click one button that will invoke my plugin to invoke a js function, after about 20s, countered the error: "E/DroidGap(21383): DroidGap: TIMEOUT ERROR! - calling webViewClient" in eclipse…
explorer
  • 449
  • 2
  • 10
  • 19
2
votes
2 answers

Implementing timeout in webviews

I need to implement timeout for my webviews. I want to show the user n error message if the webpage could not be loaded within a desirable time. Is there any way to do this?
Arnab Chakraborty
  • 7,442
  • 9
  • 46
  • 69
2
votes
1 answer

WebViewClient.shouldOverrideUrlLoading() documentation clarification

Referring to the API level 24+ only version of shouldOverrideUrlLoading, the documentation clearly states: Note: Do not call WebView#loadUrl(String) with the request's URL and then return true. This unnecessarily cancels the current load…
2
votes
2 answers

How to Programmatically Enter form input fields in WebView, then click submit?

I don't have any problem parsing WebView HTML or loading URLs (relative or absolute) but I am stumped as to how to programmatically "simulate" the user entering username & password, then clicking the submit/login button, given the following…
ef2011
  • 10,431
  • 12
  • 49
  • 67
2
votes
0 answers

How to throw Network errors in Android WebView?

I am using Android WebView in my App. I know that there is a method onReceivedError(final int errorCode, final String description, final String failingUrl) that gets triggered in WebViewClient I know the WebView triggers it automatically when there…
Rohit Singh
  • 16,950
  • 7
  • 90
  • 88
2
votes
1 answer

shouldOverrideUrlLoading Will Load "file:///" But Not "http://" URL Parameters

Works: mWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl("file:///android_asset/www/css-js/app.css"); return true; } }); Doesn't…
Nuri Hodges
  • 868
  • 6
  • 13
2
votes
2 answers

Check Url completely loaded Webview

I want to show a progressBar till all resources are loaded. I've tried below code, but progressBar will go off when resources starts loading. dataBinding.webviewGallery.setWebViewClient(new WebViewClient() { @Override public boolean…
Shahal
  • 1,008
  • 1
  • 11
  • 29
2
votes
0 answers

Webview shouldOverrideUrlLoading not catching URL requests

I am trying to parse every click event, intercept the http url that attempts to load into the webview, and decide if it should be shown depending on a set of logic as per how the url parses. I have followed the advice on these 3 StackOverflow…
PGMacDesign
  • 6,092
  • 8
  • 41
  • 78
2
votes
2 answers

Web View not working with some specific url

public class MainActivity extends AppCompatActivity { String url = "https://www.pinterest.com"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
2
votes
1 answer

WebViewClient::onReceivedSslError is not called

I have attached my WebViewClient implementation to my WebView. appView.setWebViewClient(new AppViewClient()); My onReceivedSslError and onReceivedError implementations are called with all expected errors except for Mixed Content error. My…
malhobayyeb
  • 2,725
  • 11
  • 57
  • 91
2
votes
1 answer

Android 7 webview not loading urls after some time

we are experiencing a weird issue in our mobile app with devices running Android 7., although 6. are working fine for the same code. Users can navigate through different urls successfully in the embedded webview we have in our app but at some point…
2
votes
1 answer

Android - WebViewClient loads pages extremely slowly

As a developer, I have had pretty bad experiences when it comes to building apps (with web pages) that run on the Android webviewclient on 3G connection. A few of my users are saying that some pages take up to 10 minutes to load. (I don't know if…
user561212
  • 43
  • 1
  • 5
2
votes
2 answers

Intercept html button click

is there any possibility to intercept when a user clicks on a html button? I ve an webviewclient that load a login page with two buttons. Allow and Deny. I would you like to intercept when the deny button is pressed. (Deny and allow have the same…
Blackbelt
  • 156,034
  • 29
  • 297
  • 305
2
votes
1 answer

Android - Webviewclient onReceivedHttpError determine if is main resource

WebViewClient.onReceivedError was deprecated, now I have to use onReceivedHttpError to handle the webview errors, however this method receives the error from any resource, which is not what I desire. I wish only to detect the main URL failing. How…
htafoya
  • 18,261
  • 11
  • 80
  • 104