title: Check if device has internet connection
body: <p>I want to check if the device has internet connection. I have found a lot of solutions but I can't do something like this in example:</p>
  
  <pre><code>if(device has Internet connection){
      webview.loadUrl("http://the.url.com")
  }
  else{
      Toast.makeText(context, text, duration).show()
  }
  </code></pre>