BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 02-20-2009, 03: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

100-PCS LOT Silver Mica MICA Cornell Dubilier CDE CD15 240pf 500v
$0.99
100-PCS LOT Silver Mica MICA Cornell Dubilier  CDE CD15 240pf  500v picture6C 100-PCS LOT Silver Mica MICA 360pf 500v
$0.99
6C 100-PCS LOT Silver Mica MICA 360pf  500v  picture5j 100-PCS LOT Silver Mica MICA 36pf 300v
$0.99
5j 100-PCS LOT Silver Mica MICA  36pf  300v picture6F 50-PCS LOT Silver Mica MICA Cornell Dubilier CD19FD122J03 1200PF 500V
$0.99
6F  50-PCS LOT Silver Mica MICA Cornell Dubilier CD19FD122J03  1200PF  500V picture6J 100-PCS LOT Silver Mica MICA Cornell Dubilier CD10CD030D03F 3PF 500V
$0.99
6J  100-PCS LOT Silver Mica MICA Cornell Dubilier CD10CD030D03F  3PF  500V picture






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