0
votes

I have a question about this error message

'WebViewClient.OnReceivedError(WebView, ClientError, string, string)' is obsolete: 'deprecated'

public override void OnReceivedError (WebView view, ClientError errorCode, string description, string failingUrl) { Help_Activity.swipeRefreshLayout.Refreshing = false; Help_Activity.swipeRefreshLayout.Enabled = false;

            base.OnReceivedError (view, errorCode, description, failingUrl);

and this error message

Report_Activity.MyWebViewClient.ShouldOverrideUrlLoading(WebView, string)' overrides obsolete member 'WebViewClient.ShouldOverrideUrlLoading(WebView, string)'. Add the Obsolete attribute to 'Report_Activity.MyWebViewClient.ShouldOverrideUrlLoading(WebView, string)

public override bool ShouldOverrideUrlLoading (WebView view, string url) {

does anyone have an idea?

1
You have not mentioned which OS you have used for development and which OS version is throwing this exception. It looks like the android version on which code running is not supporting this method.Manoj Choudhari

1 Answers

0
votes

public void onReceivedError (WebView view, int errorCode, String description, String failingUrl) is deprecated. You will have to use onReceivedError.

public void onReceivedError (WebView view, WebResourceRequest request, WebResourceError error)

From Doc :

Report web resource loading error to the host application. These errors usually indicate inability to connect to the server. Note that unlike the deprecated version of the callback, the new version will be called for any resource (iframe, image, etc.), not just for the main page. Thus, it is recommended to perform minimum required work in this callback.

https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedError(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20android.webkit.WebResourceError)