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 7408573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:56:26+00:00 2026-05-29T05:56:26+00:00

So I am currently developing an Android game for a school project, and there

  • 0

So I am currently developing an Android game for a school project, and there is no ending to the game, it just goes on forever. I want to make it a time dependent game where if the player survives a certain amount of time, the game ends and says “Congratulations” and shows a dialog box with a button that once pressed, closes out the game. I know about the AlertDialog.Builder class and I saw somewhere that an activity can be closed by a finish() method, so anyone that can elaborate how to implement this in my game class would be very helpful, all efforts so far have just made the game crash.

  • 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-05-29T05:56:26+00:00Added an answer on May 29, 2026 at 5:56 am
    Runnable run = new Runnable(){
         public void run(){
                 displayDialog();
         }
    };
    this.runOnUiThread(run);
    
    
    private void displayDialog() {
        new AlertDialog.Builder(ProvaActivity.this).setPositiveButton("finish", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int whichButton) {
                finish();
            }
        }).show();
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing an android project using eclipse JAVA and I had just
I'm currently developing a game for Android and I want to take screenshots of
I'm currently developing a small OpenGL game for the Android platform and I wonder
I'm currently developing a simple 2D game for Android. I have a stationary object
I'm currently developing my first android app, and my first game. I've been developing
I'm currently developing an Android game which saves data into a SQLite database. This
I am currently developing an Android game that is similar to a classic arcade
I'm currently developing a game for android. I have added buttons to allow the
I am currently developing an android application. I want the user to select an
I have just started developing in Android and I am trying to make a

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.