I show a website in a webview. I want now to show at first a blank screen with a logo at the top and a text “Checking Internet Connection”. When the connection is available, then I show the website in a webview.
Later when the internet connection failed, I want to show the same blank screen with the logo and the Text “Checking Internet Connection and trying to connect”.
I show a website in a webview. I want now to show at first
Share
before actually show the webview content, you can
WebView.loadUrl (String url)the url can be local file in
/assetsfolder, you can use a simple html which like yourupdating:
step1 :check the internet, this is you can control
step2: try to load actually website,
WebView.setWebViewClient(new WebViewClient(...))in your
WebViewClientclass , override methodpublic void onReceivedError (WebView view, int errorCode, String description, String failingUrl)when receive error, you can
WebView.loadUrl(...)