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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:27:18+00:00 2026-06-06T03:27:18+00:00

I want to pause the timer thread….or i can say want to put it

  • 0

I want to pause the “timer” thread….or i can say want to put it into “wait” mode and then notify after something gets completed.

Timer _catchTimer = new Timer();
CatchAppNameTimer _catchTimerTask = new CatchAppNameTimer(_catchTimer);
_catchTimer.schedule(_catchTimerTask, 0, 5000);

My “TimerTask ( _catchTimerTask ) ” everytime shows a Popup screen ….that popup screen has two buttons – Unlock, Cancel.

basically i want that until user clicks on…. one of the Unlock / cancel btn, Time thread gets set on wait mode….. when user click one of the Unlock / Cancel button………… only after then Time thread gets notifiy.

Currently I am using a boolean variable in run method of “timertask” ….. to handle the deadlock situation…… that is TimerTask get called in every few secs……even when popup screen already shown……….

As follows :

public void run() { 


GlobalSingleton obj = null; 
  obj = GlobalSingleton.getInstance(); 
  if( obj.getShowDialog() ) 
        return;

   unlockField();
}

when first time “unlockFiled()” called……..i set a boolean variable as true (using Runtime Store) ……. which value is retrived by getShowDialog() method. and in

fieldChanged(Field field, int context) { } method of both Unlock / Cancel button……… i set the boolean var’s value as false…… by calling …

GlobalSingleton obj = null;
obj = GlobalSingleton.getInstance();
obj.setShowDialog(false);

But the right approch is “timer-task” should not be started again……. untilll user press either Unblock / Cancel button and control gets out of the fieldChanged(Field field, int context) { } method.

shuld i use a differnet thread to handle the….wait – notify operations on the Timer object….on the basis of a boolean variable. i hv already tried this approach………. but cant get a solution…

i’ll be gratefull for any suggestions….

Regards.

  • 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-06T03:27:19+00:00Added an answer on June 6, 2026 at 3:27 am

    thanks BOSS and Alexey for ur contribution, I have solved my problem with a continuously running thread having sleep for 1 sec.

    My solution is given on –
    solution
    or at : main thread
    Please vote if u find my solution helpful as I need some reputations for start chat on blackberry rooms.

    thnks.

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

Sidebar

Related Questions

Let's say I want to pause a thread so that other threads can run
In this code I want to Pause/Resume a thread using an AutoResetEvent and a
Both Thread.Sleep(timeout) and resetEvent.Wait(timeout) cause execution to pause for at least timeout milliseconds, so
I want to pause 1 second for every time it loops, it is usually
I am executing a function and i want to pause execution for some time.
I want to pause UIImageView animation and based on my research found that you
I want to pause my android application when the phone receives an incoming call.
I am developing music application . I want to pause the player and when
i want to play the video of this URL http://www.youtube.com/watch?v=JPUWNcGDyvM&feature=player_embedded where i PAUSE last
I want to make a pause between two lines of code, Let me explain

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.