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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:28:58+00:00 2026-05-23T01:28:58+00:00

I am using an AlertDialog to pop up and ask the user for some

  • 0

I am using an AlertDialog to pop up and ask the user for some information, when the user clicks on a button.

The dialog is working fine, and I get the user info it dismisses itself.

However when the app returns focus to my primary view.. it is setting the focus to an EditText widget which causes the keyboard to appear for that View.

I don’t want the Keyboard to appear unless the user explicitely puts focus on that field, so how do I change/override the default behavior, so that it doesn’t autofocus on this field after the AlertDialog is dismissed.

It doesn’t behave this way when the view initially inflates, the field is focused (highlighted), but the keyboard is not visible, only after the user taps on the field does the keyboard come up when the app launches. This behavior after dialog dismiss is completely different.. any ideas?

(No the EditText is not anywhere near the buttons of the alert dialog, so its not as though a second tap or something is happening accidentally or the click is being passed up the stack.)

  • 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-23T01:28:59+00:00Added an answer on May 23, 2026 at 1:28 am

    The issue was as stated in comments above, I was not dismissing the keyboard from the ALERTDIALOG, I was working on the false assumption that when the dialog was dismissed that the keyboard would be as well. This assumption was wrong.

    The keyboard for the alert dialog was not dismissed, the view returned to the parent view and because the edit text in the parent view got focus the keyboard updated itself to appear properly for this view.

    The attempts to dismiss keyboard in the dialog dismiss listener did not remove the keyboard because they were trying to dismiss the keyboard for fields in the parent window and at the time of their execution it was still tied to the field in the alertview.

    Add the dismisskeyboard calls to the onclick events that dismissed the dialout for the edittext fields in the alertDialog resolve the problem.

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

Sidebar

Related Questions

I am using a custom Alert dialog. If user go with negative button of
I have created an AlertDialog using AlertDialog.Builder, but the Dialog border takes up too
I am attempting to pull some information from my tnsnames file using regex. I
I am using AlertDialog with setMultiChoiceItems to let the user select multiple items which
I'm creating an Alert dialog by using the following: AlertDialog.Builder builder = new AlertDialog.Builder(context);
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button
Using C#, I need a class called User that has a username, password, active
I am using an AlertDialog that is very simple, just a custom view with
Using the following code snippets, I'm trying to get the text value which has

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.