Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to pause the timer thread
    primarykey
    data
    text
    <p>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. </p> <p><code>Timer _catchTimer = new Timer(); CatchAppNameTimer _catchTimerTask = new CatchAppNameTimer(_catchTimer); _catchTimer.schedule(_catchTimerTask, 0, 5000);</code></p> <p>My "TimerTask ( _catchTimerTask ) " everytime shows a Popup screen ....that popup screen has two buttons - Unlock, Cancel. </p> <p>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. </p> <p>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.......... </p> <p>As follows : </p> <pre><code>public void run() { GlobalSingleton obj = null; obj = GlobalSingleton.getInstance(); if( obj.getShowDialog() ) return; unlockField(); } </code></pre> <p>when first time "unlockFiled()" called........i set a boolean variable as true (using Runtime Store) ....... which value is retrived by getShowDialog() method. and in</p> <p><code>fieldChanged(Field field, int context) { }</code> method of both Unlock / Cancel button......... i set the boolean var's value as false...... by calling ... </p> <p><code>GlobalSingleton obj = null; obj = GlobalSingleton.getInstance(); obj.setShowDialog(false);</code></p> <p>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 <code>fieldChanged(Field field, int context) { }</code> method. </p> <p>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... </p> <p>i'll be gratefull for any suggestions.... </p> <p>Regards.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload