How to pause the timer thread...

Hello

I want to make a break the "timer" thread... or I can tell want to set mode 'waiting' and then notify when something is filled.

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

My "TimerTask (_catchTimerTask)" whenever displays a Popup...

This popup form has two buttons - unlock, undo.

Basically I want that, until the user clicks on... a the unlock / cancel btn, thread prepares time on standby... when the user click on open it / cancel... only after then time button thread gets notify.

I am currently using a Boolean variable in the run method of "timertask"... to handle the deadlock situation... it's TimerTask called in every few seconds... even when the popup screen showed...

As follows:

public void run()
{
GlobalSingleton obj = null;
obj = GlobalSingleton.getInstance ();
        
If (obj.getShowDialog ())
return;
       
unlockField();
}

When the first "unlockFiled()" called... I put a Boolean variable as true (using Runtime store)... whose value is extracted by the getShowDialog() method.  and in

fieldChanged (field field, int context) {} method of two Unlock / Cancel button... I put Boolean value of var as wrong... by calling...

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

But the right approach is "timer task" should not be repeated... until the user either unlock / cancel button and the control becomes out of {} fieldChanged (field field, int context) method.

should I use a differnet thread to manage the... wait - notify operations on the Timer object... based on a Boolean variable.  I hv already tried this approach... but impossible to get a solution...

I will be gratefull for your suggestions...

Kind regards.

I wouldn't use a timer for this job, I would use a Thread running continuously.  The wire would be just "sleep" for a second, then check.

In regards to your screen, you have two choices.

(1) the easiest is simply put your app in the foreground.  This means that you can actually leave the currently running Thread.  Because if your application is in the foreground, it will not try to block.

With this approach, the screen that you view will be a simple screen and you can code like that.

When the user enters the PIN code, you can make the activity on the native application.

(2) the other option is to use a Global context screen.  It's possible but more complicated to code and I see no benefit to this approach (1), except that he's looking for a little more "pleasant".  But I don't think that "kindness" is important to you.

As indicated on the other thread, I don't know how to close the native application.  But who needs to be discussed on the other Thread.  Have this concentration of Thread on sort how to get your screen to superimpose the native application after checking every second.  The approach I have to do it and a lot easier than trying to use a timer task.

Tags: BlackBerry Developers

Similar Questions

  • How long does take to load lightroom? and how to pause the download and start later?

    How long does take to load lightroom? and how to pause the download and start later?

    Hi AdobeIDBailey,

    The time required to download the product depends on the speed of your internet connection.

    The download cannot be suspended once launched, it will stop when you are finished, or if you cancel it.

    If you see it is stuck or not moving not quite so if please cancel the download and refer to the steps below and try the download again: (these steps will also increase the speed of downloading as security software can also slow your downloads)

    1. turn OFF any security software or firewall installed on your machine temporarily

    2 - CUT the browser protection tools or add as well as for now.

    Let us know if that helps.

  • How to set the time that my screen stays on?

    How to set the time that my screen lights up.  I have an iPod Touch 6?

    Settings > general > auto-lock

  • How to set the time between slides in a slideshow (iPhoto, el capitan)

    How to set the time to say - 5 seconds or 20 seconds - between slide show photos in iPhoto. I use el capitan.

    See the Settings button at the bottom right of the toolbar (at the bottom of the slide show). Click on it and you have a small window with two tabes, refers to all the slides, the other to the selected slide. You can make your choice

  • On Apple Watch, how to change the time when traveling to a different country, like London or Singapore?

    For Apple Watch, can someone please show me how to change the time on my watch when I travel to another country, like London or Singapore? Thank you.

    Hello

    When traveling to a different time zone, it is not necessary to manually change the time on Apple Watch.

    After turning off the flight on each of your iPhone and Apple Watch, the time on your watch can be updated automatically to reflect the local time.

    If it is not the case, try restarting your watch:

    -To switch off your watch: press and hold the button side until you see the cursor off the power; slide it to turn off.

    -To reactivate: press and hold the side button until you see the Apple logo.

  • How to view the "timer" current user time

    Hello

    How to display the "timer" right now?

    Currently I have in my program using timer, how to display the current time left on the timer to warn the user the time left on the timer?

    The number of timer upward or the countdown?

    using TimerCB

    a Council does

    Thank you

    Ben

    I'm not aware of the possibility of obtaining the hour up to what a timer callback will be called, then I would say a different approach:

    If, say, you want some action to happen every 10 minutes, but I would like to update the user interface of every second indicating the remaining time I would set the timer to 1 s interval. In the reminder of the timer, I would use a setting that is incremented each time the callback is called; If this value reaches 60 x 10 I reset the parameter and call the function to get the job done. In all other cases, you can simply view 600 - setting (in seconds) than the rest of the time.

    An alternative may be to use two counters, one for the action, called every 10 minutes, and one for the update of the UI, called say every second...

  • How to prolong the time that deleted files stay for me to see

    How to prolong the time that deleted files stay for me to see

    Original title: files deleted

    How to prolong the time that deleted files stay for me to see

    Hello

    You ask about the trash?

    Files remain in the Recycle Bin until you manually clear the location or you or someone else, manages the disk cleanup.

    If you do not ask the trash, please provide details.

    Don

  • How to extend the time that your computer stays on without activity

    How to extend the time that your computer stays on without activity?

    How to extend the time that your computer stays on without activity?

    Start button > in the search box, type power options > press the Enter key > left column > click on choose when turn off display > selections for battery and plugged inare. Click on the pointer, and you can choose how long. It may be 1 minute forever. Take that seek you. > click save changes when done. For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • How to set the time stamp for incoming mail?

    How to set the time stamp for incoming mail?  I have windows vista. I use hotmail/windows live email. My computer has the time is set correctly. My e-mail timestamps incoming messages 7 hours a head of real time. Example: it is now 09:48. A new email is stamped as to settle at 16:48. How can I fix it? Note: the computer is correct.

    Thank you
    Laura
    2.13.2012

    If you mean the customer of email Windows Live Mail, the time stamp on messages is governed by your time zonesystem. Right-click on the clock in the lower right of the screen and select CONFIGURATION... Change your time zone, and then set your clock at the present time.

    If you are talking about the Windows Live Hotmail service, the time zone (s) used are those contained in your account data. Reach
    https://account.live.com/EditProf.aspx
    and change the time zones for the good...

    Windows Live programs and services have their own forums for support at the Windows Live Solution Center. Please address any questions you may have about Windows Live Mail to one of the forums on the right side of this page. For Hotmail, forums and responses are available via this page.

    Noel

  • How to reset the time in the lower right corner, so it remains set automatically

    original title: Windows Internet Explorer 8 - time

    How to reset the time in the lower right corner, so it is set automatically.

    ccrow

    The time is not defined in Internet Explorer. The time is a function of the o/s. right click on the time and see what happens.

  • How to pass the time slot to the dashboard in URL parameters

    Hi all

    Does anyone have example on how to spend the time slot to the dashboard in URL parameters?

    That's what I tried. Normally, the dashboard has timeRange as a required context, I deleted and added "startTime" and "end" like required context, so that I can spend 2 timestamps in URL, and then I created a 'extra context' called "timeRange", which calls a WCF function to create a CustomTimeRange, it works pretty well. But the problem is if I have exploration down this dashboard to a different dashboard, the slot not transmitted properly. So I guess, I was not the right way. Does anyone have an example?

    Thank you

    Xiaoning

    1 re: timeRange not spent in drilldown pages

    Please confirm that you have defined one or more entries in context "Required". If you do not, please add a (like "hostName") and re - test. It work?

    2. with 'nologin' user URL redirects to the login screen

    Yes, what is expected. With nologin user, you should always use the form http://foglight_fms:80/console/foglight_ext?viewId=system:mywcfmodule.1?hostName=myhost of the URL rather than the

    form of http://foglight_fms:80/console/page/System:mywcfmodule.1?hostname=myhost .

    It would be great if you could post a brief description of your design dashboard once you have this work. That sounds like something that the other members of the Foglight community would be very interested!

    Kind regards

    Brian Wheeldon

  • How to display the time of growth of the autoextended oracle files?

    Hello

    How to display the time of growth of the autoextended oracle files?

    Hello

    1. do you have re - seen view data dictionary in the oracle documentation?

    DBA_DATA_FILES

    dba_free_space

    dba_Tablespaces

    -Regarding (updated)

    DBA_HIST_SEG_STAT

    DBA_HIST_SNAPSHOT

    DBA_TABLESPACE_USAGE_METRICS

    DBA_HIST_TBSPC_SPACE_USAGE

    2. If not, then re - discovers once and understand the use of columns and build the query.

    3. If Yes, then why you have not tried to build queries

    4. again, if you're lazy, search in google or forums. ton of translates queries

    5. What are the disadvantage of step 4 - you will not get to learn something (0% gain of knowledge).  If you really want to learn, then try to learn to build query, and try to understand the views of data dictionary

    6. When you spend above task at the end of the task you will get satistided with two things

    --> Understand how to use the Oracle docs for help and where to look in the future

    --> Your skills / knowledge gain - trust me it will make you another step to learn new things.

    7. If you don't know SQL, learn the basics takes hardly 2 to 3 hours and then you can build query.

    It may be useful

    -Pavan Kumar N

  • How to find the time to process a request?

    IM using oracle express edition, can someone help me, how to find the time to process a request?

    Trace queries and tkprof the trace file generated.
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e16638/SQLTrace.htm#PFGRF01010

  • How to calculate the time to SELECT

    I want to know how to calculate the time taken by the SELECT query.

    For example: I run a select statement in TOAD (oracle version 9i) who takes 40 seconds to run, but in the output window, it displays few records. It says "list 1 of 500 records, more records exist". This table has total 20 million records.

    Now my question is: have you my SELECT query took 40 seconds? or it took 40 seconds to SELECT 500 records.

    If it took 40 seconds to SELECT 500 records then how to calculate the total amount?

    Any help would be much appreciated.

    To avoid the exit which is probably not really need you can make

    begin
      for c in (select * from xy /*your query */)
      loop
        null;
      end loop;
    end;
    /
    

    This gives an estimate of the time to recover all the lines.

  • How to reset the timer to zero?

    Good day people,

    How to reset the timer to zero?

    I have a button in the timeline relative to the code below, and when I click on it I want to the behavior of the time back to 1 or 0.

    Click the timer to 1 or 0.

    -----------------------------------

    contents_mc - timer_txt

    -----------------------------------

    _root.elapseTime = 0;

    intervalId = setInterval (this, "countDown", 1000);

    function countDown() {}

    {if (_root.timerOn)}

    ++ _root.elapseTime;

    " _root.elapseTime = _time +" "seconds";

    if(_root.elapseTime == 10) {}

    _parent.gotoAndStop ("GameOutOfTime");

    clearInterval (intervalId);

    }

    }

    }

    Stop();

    Any response will be appreciated,

    Thank you

    use:

    function resetF (): Void {}

    clearInterval (intervalID);

    intervalId = setInterval (countDown, 1000);

    }

Maybe you are looking for