I am working on a webview client app in Android Studio. I have a working splashscreen.
I want to check the internet connection, or check if the webpage is available. If not, then go to another activity than my webview activity.
I am working on a webview client app in Android Studio. I have a working splashscreen.
I want to check the internet connection, or check if the webpage is available. If not, then go to another activity than my webview activity.
You can do a simple thing load the webpage using custom WebViewClient overriding onPageError Method and starting The Activity in That Method.
class CustomWebViewClient extends WebViewClient(){
onReceivedError(WebView view, WebResourceRequest request, WebResourceError error){
startActivity(new Intent(this,Your_Second Activity.class));
}}
And set WebView Client Like
webview.setWebViewClient(new CustomWebViewClient());