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

  • Home
  • SEARCH
  • 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 6022223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:49:40+00:00 2026-05-23T03:49:40+00:00

I have a weird bug in my program which I can only explain in

  • 0

I have a weird bug in my program which I can only explain in one way.

When I click on a certain button in my menu screen the user gets an AlertDialog which asks him how he wishes to proceed.
Whichever he chooses he is then passed on to another activity.

Thing is, than when the user exits that activity and thus returns to the menu activity, the dialog seems to be still open.
Thing is that it doesn’t happen every time.

I haven’t put a dismiss() in my code but I was sure that it does so automatically.

            AlertDialog alertDialog = new AlertDialog.Builder(YanivMenuActivity.this).create();
            alertDialog.setTitle("Active Game");
            alertDialog.setMessage("You are in the middle of a game.\nStarting a new game will cancel that one.\nHow do you wish continue?");
            alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "Start New Game", 
                      new DialogInterface.OnClickListener(){
                        @Override
                        public void onClick(DialogInterface arg0, int arg1) {
                            inGame = false;
                            startActivity(new Intent(YanivMenuActivity.this,YanivGameActivity.class).putExtra("reset", true));
                        }
                      });

            alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, "Continue Old Game", 
                      new DialogInterface.OnClickListener(){
                        @Override
                        public void onClick(DialogInterface arg0, int arg1) {
                            startActivity(new Intent(YanivMenuActivity.this,YanivGameActivity.class).putExtra("reset", false));
                        }
                      });
            alertDialog.show();
  • 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-23T03:49:41+00:00Added an answer on May 23, 2026 at 3:49 am

    You’ve almost answered your own question. You need to call dismiss() just before your startActivity(...); call.

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

Sidebar

Related Questions

I have a weird date rounding problem that hopefully someone can solve. My client
I have a weird issue that only seems to be affecting IE 7. The
Hey fellas, I have this weird bug, and I have no clue how to
i'm trying to get started with silverlight 2. i have a weird bug. every
This has been driving me nuts all day. I have a weird bug that
I have a weird error in my C++ classes at the moment. I have
We have a weird intermittent problem with saving from Word 2007 to our SharePoint
i have a weird problem. i would like to delete an assembly(plugin.dll on harddisk)
I have a weird problem with images in visual web developer, I cant change
We have a semi-weird issue for our site. Consistently, from 1 anonymous* user the

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.