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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:41:21+00:00 2026-06-18T11:41:21+00:00

In my app, I’m using an AlertDialog with a custom view. This view contains

  • 0

In my app, I’m using an AlertDialog with a custom view. This view contains a couple of EditTexts and a few other things. There are some listeners attached to the EditTexts that perform whatever functionality is needed.

On the button click of the dialog, I am performing some validation on the data entered into the EditTexts and display another AlertDialog if the data is invalid. Once that (second) dialog is closed, I want to remain on the main dialog (with the custom view), but for some reason that dialog is closed before my second dialog is shown. How can I keep the original (custom view) dialog still open under the second dialog?

Here’s my (simplified) code:

final EntryPanel panel = new EntryPanel(OrderActivity.this);

AlertDialog dlg = new AlertDialog.Builder(OrderActivity.this)
    .setCancelable(true)
    .setView(panel)
    .setPositiveButton(R.string.button_ok, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            final int id = pePanel.getProductId();
            if(!isValidProduct(id)) {

                new AlertDialog.Builder(OrderActivity.this)
                    .setMessage(R.string.error_unknown_product)
                    .setCancelable(true)
                    .setPositiveButton(R.string.button_ok, new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface dlg2, int which) {
                            dlg2.cancel();

                        }
                    })
                    .show();
            }
            else {
                processProductEntry(id);
                dialog.dismiss();
            }
        }
    })
    .setNegativeButton(R.string.button_cancel, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            dialog.cancel();
        }
    }).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-06-18T11:41:22+00:00Added an answer on June 18, 2026 at 11:41 am

    So, it’s not possible to keep both dialogs open. Therefore I changed the first dialog (with the custom view) to be an activity with theme being Theme.Dialog – it displays the way it should – and then open the second dialog from it. This way, when the second dialog is opened, the original activity (which looks like a dialog) is still visible in the background.

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

Sidebar

Related Questions

My app contains 3 views ( for now ) each button has a few
App.Views.VideoView = Backbone.View.extend({ initialize: function() { _.bindAll(this, 'render'); this.model = this.options.model; this.render(); }, render:
The app should forward to another view controller based on some data in a
My app is saving some images on the SD Card, in the AppImages directory
App.config looks like this: <appender name=MemoryAppender type=log4net.Appender.MemoryAppender> <layout type=log4net.Layout.PatternLayout> <conversionPattern value=%date [%thread] %-5level -
App A has this BroadcastReceiver in its manifest (within <application>): And this receiver: public
My app uses MySQL on one platform and SQLite on another, as such there
My app is free and, using in-app purchases, I'd like to enable additional functionality.
My app compiles to about 80mb. I was under the impression this was quite
My app fails at this line of code: Dim objConnection As New SqlConnection(Application(ConnString)) My

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.