Android: how to close app if no Internet connection available?
<p>I am developing a game on Android, and it requires an Internet connection to be played. I know how to check whether a connection is available or not, but I am not sure what to do in case the connection is not available. </p>

<p>My idea is to display a "No Connection Available" dialog to the user, with an "Exit' button right below it, so that he can close the app from the dialog and fix his connection. I would be doing this with the System.exit(0) command.</p>

<p>However I've read in many places that I shouldn't use that command or close my app, and instead let the OS handle this. </p>

<p>But how can I solve this situation without using System.exit(0)?</p>

<p>I believe the DrawSomething game also checks for an Internet connection and presents you with an "Exit" button in case you don't have one. Not sure what method they are using to close the app though.</p>
