title: Close Application if no internet connection
body: <p>OnCreate of my "Home" activity, I want to check if there's internet connection, if false just close my activity showing a toast..<br/>
  But, my Home Activity could not be the first on stack, so if just set finish(); it could just close this activity and show the top one in activity stack..
  <br/>So I've written down this code, but does it make any sense?</p>
  
  <pre><code> if(!Utils.isOnline(mContext))
          if(!moveTaskToBack(true))
              finish();
  </code></pre>
  
  <p>Where Utils.isOnline() is just my method to check internet connection</p>
  
  <p><strong>EDIT</strong>: I've already created my method to check internet connection and it's Utils.isOnline().. So I'm not asking how to check internet connectio...</p>
  
  <p><strong>EDIT2</strong>: moveTaskToBack() probably is not best choice to achieve my target, because yes it puts my activity onBackGround but if I reopen it, app doesn't check anymore my condition (Don't know why.. it skips onCreate(?)) and shows a blank activity..</p>