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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:25:53+00:00 2026-05-17T02:25:53+00:00

In a long-running operation, I’m showing a popup dialog (created from ProgressDialog to prevent

  • 0

In a long-running operation, I’m showing a popup dialog (created from ProgressDialog to prevent other operations from happening).

I have made it non-cancellable with setCancelable(false), so I can’t close it using the back button, but surprisingly, the Search hardware button dismisses the dialog!

More exactly, the global search application is displayed, and when I come back to my app, the dialog has been dismissed.

Any idea how to prevent the dialog from being dismissed?

  • 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-17T02:25:53+00:00Added an answer on May 17, 2026 at 2:25 am

    This works (notice I put it on the dialog builder):

    .setOnKeyListener(new DialogInterface.OnKeyListener() {
    
        @Override
        public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_SEARCH && event.getRepeatCount() == 0) {
                return true; // Pretend we processed it
            }
            return false; // Any other keys are still processed as normal
        }
    })
    

    Maybe it’s even possible to grab the positive and negative button presses, and only handle these, return true for any other keys. Would be curious if you can figure that out…

    PS: I read somewhere there are more “holes” in the dialog, i.e you can get rid of it without hitting any buttons on it. This was apparently one. Does anybody know of any others?

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

Sidebar

Related Questions

I have UI which displaying status of long-running operations (downloading some text files from
I have a long-running cleanup operation that I need to perform in onDestroy() of
Context: From my javascript web UI, I launch a long-running (several minutes) operation that
I have a long running operation which I am putting on a background thread
I have a long running operation: void LongRunningOperation(string someValue); How do i call it
I have a long operation running in the background, like uploading stuff, converting images,
I have a running system that process short and long running operations with a
I have a long-running operation which I perform in a background thread. As it
I have a long running operation in PHP and it always crashed with an
Possible Duplicate: C# WinForm Application - UI Hangs during Long-Running Operation I created a

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.