title: Check internet connection in ANDROID
body: <p>Hello I have application based on data retrieved over internet... </p>
  
  <p>How can I handle my app in case there is no connection available?</p>
  
  <p>I can detect connection with</p>
  
  <pre><code>ConnectivityManager cm = (ConnectivityManager) 
  getSystemService(this.CONNECTIVITY_SERVICE);
  return cm.getActiveNetworkInfo().isConnectedOrConnecting();
  </code></pre>
  
  <p>It works fine... But how can I prevent Force Erros when I know there is no connection? I would like a message to be shown - something like: "Sorry! There is no internet connection available!" and not my application to crush...</p>