Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8028773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:13:28+00:00 2026-06-05T00:13:28+00:00

I am developing a game on Android, and it requires an Internet connection to

  • 0

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.

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.

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.

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

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:13:29+00:00Added an answer on June 5, 2026 at 12:13 am

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

    Check for the Internet connection in your first activity, and call finish() to get rid of that activity if there is no Internet connection (or, more accurately, after the user clicks on your confirmation dialog).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an android app, and have developed a game, but I now have
I am developing an android game application played using bluetooth. While searching for bluetooth
I'm developing a little game (test) for Android, but I don't understand the logic
Im developing a game for android but I noticed one bug that I cant
I'm developing chess game for Android ( androidchess.appspot.com ). If I want to add
I am developing a game for android an i'm working on the menu screen
I have been developing a game basic card game for Android. At the moment
I'm developing an Android game in Java which uses Lua scripts. To execute these
I'm developing an Android game that uses the orientation sensor to get the rotation
I am developing a 2d game on Android ICS using OpenGL es 2.0 and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.