title: android - how to prevent webview to load when no internet connection
body: <p>I have an Android app which has a webview. When there's no internet connection, webview will display page not available. I want to make this look like an app as much as possible, so I don't want to display this page. I found some useful info online teaching you how to hide or load something else to cover it, but what I really want is to stay at the current page and a little pop up dialog says no connection. Basically, when user clicks on anything inside the webview, check for connection first. if no connection, stay at where it was and pop out a dialog box.</p>
  
  <p>Thanks for the help!!</p>
  
  <p><strong>Edited:</strong></p>
  
  <p>Like I said, I already know how to check internet connection from the samples online. My problem is I don't know how to stop loading the next page. To be clear, when users try to go to the next page, check for internet connection. If no connection, the page will stay at where it was and would not go to the next page. I want users able to see their last loaded page and get informed while webpage content is still there. thanks!</p>