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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:53:07+00:00 2026-06-10T14:53:07+00:00

I have a progress dialog which is shown during some running action. If the

  • 0

I have a progress dialog which is shown during some running action.

If the action hasn’t executed for a given time, I want to dismiss the dialog and the action. How do I implement this?

I currently have these two methods, which stop and start my async action and dialog:

private void startAction()
{
    if (!actionStarted) {
        showDialog(DIALOG_ACTION);
        runMyAsyncTask();
        actionStarted = true;
    }
}

private void stopAction()
{
    if (actionStarted) {
        stopMyAsyncTask();
        actionStarted = false;
        dismissDialog(DIALOG_ACTION);
    }
}

i.e. I want to do something like this when the time is out:

onTimesOut()
{
    stopAction();
    doSomeOtherThing();
}
  • 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-10T14:53:09+00:00Added an answer on June 10, 2026 at 2:53 pm

    You can make a simple timer:

    Timer timer = new Timer();
    TimerTask task = new TimerTask() {
    
        @Override
        public void run() {
            stopAction();
        }
    };
    
    timer.schedule(task, 1000);
    
    • 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 built a long running script to which I have added a progress
I want to have a ProgressDialog with determinate progress bar instead of default spinner.
I have progress.js file which has the following code $('#text_area_input').keyup(function() { var text_area_box =$(this).val();//Get
I have a progress bar which inherits from JSlider to provide highlighting functionality. Highlights
I have made some progress with the DataList and UserControl this morning but I
I posted a thread about this earlier and have made some progress but now
I have a progress bar in my app but it is showing some text
I have created a C# COM DLL which is essentially an enhanced progress bar
I have an activity which preforms some work in the background and based on

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.