MartijnG
MartijnG

Reputation: 825

Check if webview can reach the server

Is it possible to check if Android WebView can reach the server or not? So if it can't reach the server or a specific website it returns something like false or so? I've searched quite a lot and some people said you can use OnReceivedError() but that doesn't work for some reason... So how can I check if the app can reach the given server (host address).

Upvotes: 0

Views: 2451

Answers (1)

Francois
Francois

Reputation: 10978

This way worked for me: https://stackoverflow.com/q/2001824/446576

Don't rely on webview errors, check connectivity instead.

To test a specific remote host, try to download a page with HttpClient (see https://stackoverflow.com/q/4724491/446576)

Upvotes: 1

Related Questions