BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-20-2009, 04:49 PM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default why i cannot pause timer

Please Login to Remove!

hi,

i've got such a problem:i use timer.scheduledAtFixedRate in another thread. the problem is, that when some action happens, i must pause this timer, and when another action happens i must resume it. it looks more or less like this:


PHP Code:
public void run(){

if( 
something1 )

{

timer.scheduleAtFixedRate(TimerTasktime1time2);

}

if(
something2){

synchronized(timer){

timer.wait();

}
}

if(
something3){

timer.notify();

}


the problem is-that i cannot pause it! wait() method just does not work and i do not know why.. the only thing that works is cancel() method. but i do not want to cancel my timer i need to pause it until 'something3' happens..



Can You please suggest me anything?


ps. i also tried to use a flag, smth like this:


PHP Code:
public void run(){

boolean flag true;

if( 
something1 && flag == true)

{

timer.scheduleAtFixedRate(TimerTasktime1time2);

}


if(
something2){

flag false;

}

if(
something3){

flag true;
}


but this also did not pause (even did not stop!) my timer...


i'll be gratefull for any suggestions..


regards
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Black apron Batman waitress server waiter waist apron 3 pockets
$11.0
Black apron Batman waitress server waiter waist apron 3 pockets pictureAirpot, Vacuum Server, 2.5 Liter, Winco Model AP-525DC
$33.17
Airpot, Vacuum Server, 2.5 Liter, Winco Model AP-525DC pictureXEROX FIERY PRINT SERVER CABLE 10031062
$49.99
XEROX FIERY PRINT SERVER CABLE 10031062 pictureNORTEL BCM SIGNALING SERVER NTDU27AB
$59.99
NORTEL BCM SIGNALING SERVER NTDU27AB pictureINTER-TEL AXXESS 827.8950 25 USER MESSAGING VOICEMAIL SERVER SOFTWARE USB DONGLE
$549.99
INTER-TEL AXXESS 827.8950 25 USER MESSAGING VOICEMAIL SERVER SOFTWARE USB DONGLE picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.