开发者

closing timer in blackberry

I am developing an application for blackberry. I have a timer, when I declare it as static & close the timer after ce开发者_StackOverflow社区rtain interval, it works. If i don't declare the timer as static and call timer.cancel(), the timer is not closed. Why is this happening?


At a wild guess I would say you are closing the timer from a different instance of the class it is part of. When it's static they are the same timer. When it isn't, it isn't.


You can cancel the timeSchedule for the TimerTask(), by calling the method cancel();

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜