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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:41:07+00:00 2026-05-23T06:41:07+00:00

I have an alert dialog, that I have 2 text fields and then a

  • 0

I have an alert dialog, that I have 2 text fields and then a Positive and Negative button.

I was trying to set the nextFocusDown on the final text field to ALWAYS be the positive button.

The positive and negative buttons are layed out beside each other below the second text field and if the cursor for user input was over the left button the nextfocus would move to the left button, if it was over the right button it would move to the right button.

So I use my alert builder to CREATE my alert Dialog and then attempted to call

myAlertDialog.getButton(DialogInterface.BUTTON_POSITIVE);
and then set the ExitText fields nextFocusDownId to that button’s ID.

and do this before I show the Alert to the user, so I don’t have the slightest chance of any racing conditions.

Alas, the ad.getButton returns NULL every single time. When I move these lines of code to after the ad.show() call, everything works perfectly.

So I guess the question I have is, can someone explain this to me. I would think once I have SET THE POSITIVE BUTTON and created the AlertDialog that the view should exist but not be visible… obviously this is not the case, so does nothing that is a DisplayWidget get create until the view is actually shown as a general rule of thumb? When views are inflated I am able to find objects within them before I show them. So what is the general rule of thumb regarding this?

  • 1 1 Answer
  • 3 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-23T06:41:07+00:00Added an answer on May 23, 2026 at 6:41 am

    I think your final statements/questions are on the right track. The call to show() on the dialog inflates and shows the view. So in sort of makes sense that you cannot interact with the view in code until the dialog is shown. I don’t see there being much of a race condition if your code to manipulate the dialog comes directly after calling show().

    Specifically, here is what the javadoc says:

    show() – Start the dialog and display it on screen.

    So the dialog is not “started” until show() is called.

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

Sidebar

Related Questions

I have a Login dialog that can create an alert dialog when the user
I have a form inside a dialog that appears after clicking in another button.
On my web page I have a button that opens a modal jQuery dialog.
I have a simple list view with some check boxes in an alert dialog.
I have an alert box that displays updates processed in php to the user
I have an alert box that is triggered when users mouseover a certain area.
For some strange reason, an alert dialog with the text title Message From Web
I have a paragraphed named dialog I am trying to add content to via
i have been trying to copy text input from alertview textfield to a NSMutableArray
I have a YUI dialog that submits a form to a Java servlet. 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.