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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:49:12+00:00 2026-05-31T01:49:12+00:00

In my Android app, I have a dialog with a few options, one of

  • 0

In my Android app, I have a dialog with a few options, one of which should result in the current dialog being displayed again.

It’s like this:

protected Dialog onCreateDialog(int id) {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    if (id == 0) {
        builder.setMessage("Message 0")
               .setPositiveButton("Show Message 0 Again", new DialogInterface.OnClickListener() {
                   public void onClick(DialogInterface dialog, int id) {
                       showDialog(0);
                   }
               })
               .setNegativeButton("Show Message 1", new DialogInterface.OnClickListener() {
                   public void onClick(DialogInterface dialog, int id) {
                       showDialog(1);
                   }
               });
    } else {
        builder.setMessage("Message 1")
               .setPositiveButton("Dismiss", new DialogInterface.OnClickListener() {
                   public void onClick(DialogInterface dialog, int id) {
                       // nothing
                   }
               });
    }
    AlertDialog dialog = builder.create();
    return dialog;
}

However, when I click on the “Show Message 0 Again” button, the dialog is dismissed and does not appear again. The “Show Message 1” button works fine.

I would prefer the dialog to actually be dismissed and then opened again, rather than simply having the “Show Message 0 Again” button just not do anything and not cause the dialog to be dismissed, if that’s possible.

  • 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-31T01:49:13+00:00Added an answer on May 31, 2026 at 1:49 am

    Here is the discussion : Dialog.show() vs. Activity.showDialog()

    Please Have a look on that…

    Hopes it Helps. 🙂

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

Sidebar

Related Questions

I am making an android app in which i have to use progress dialog
I have a dialog in an Android app that I don't want the user
I have an Android app that begins by displaying a dialog. When I set
I have a class that extends android.app.Dialog, the layout is done in an xml
I have a very simple dialog defined as: import android.app.AlertDialog; import android.content.Context; import android.view.LayoutInflater;
In my android app I have fragments, and one of them is very heavy
I have android app . i should pass the data from android to web
In my android app I have a Tabhost with a ListView as one of
In my android app i show a custom dialog. In this dialog i have
I am writing a simple android app which have a edittext and a button.

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.