Timer problem

Hi, I use timer in my application to date labelfield like this:

timer = new Timer();
            timerTask = new TimerTask()
            {
                public void run()
                {
                    counter++;
                    oopslabel.setText("" + counter);
                }
            };
            timer.scheduleAtFixedRate(timerTask, 0, 500);

It starts from 0 and I can see the increment to 1 then 2 and then it stops. I don't know why this is happening! I set period of th of 500ms, but what caused the timer stop?

Help, please!

No worries! You can find this video on the event Thread a good watch to you posted on it. In General, blocking operations are just what you need to address for a period of time or can contain up to following code execution while he is waiting for something. The most used are networks, GPS and the IO. However, when you want to update the UI that needs to be done on the event thread or now the lock of the event. You can go about using UiApplication.getUiApplication.inokeLater (new Runnable() {public void run() {//your code}}); or synchronize the lock of the event, as I showed in the previous post. There are differences between the two are probably not useful to make at this time.

Your timer is actually supported by its own Thread, so when you schedule your task you execute over the timer and not on the event Thread. It may be that you will have to play with your code, so you don't end up schedule more than one task to update your label, but the code you have, it seems that he should do the trick if only run you it once.

Tags: BlackBerry Developers

Similar Questions

  • Satellite M100-JG2 HotKey and date and time problem

    Hi all

    I'm not very good with computers, and I've had some problems for a while now. My laptop is almost three years, I don't know why I'm writing this after so long but anyway. I think they are called "keys" or "launchkeys", hopeyfully, you know what I mean, but anyway they do no more work. They worked for a while, but they do not work now. I went into the control panel and went into the 'Toshiba' orders and tried to change what does each control, but it still does not work. No one knows how to fix?

    Also, another problem that I had since I first laptop is my date and time are screwed up. If I put my 15:30 time, it works perfectly, until around 16:15, that when he goes back to 15:30 and go all the way up to 16:15 and continues in this cycle until I manually change the time. I had a few friends (no professional) to look at, but can not understand. When I start my laptop I go to settings in the start screen, try to change it was from there, but it keeps going during the cycle. If I click on the time and click on the tab "internet time" and say "update now", it updates, and then only time will work normally, but only until I turn off my laptop. Once I turn it on then next turn, it passes through this new cycle of 45 minutes. If anyone has had this problem or knows how to fix?

    I'm not very good at explaining, but I hope you guys can help! I appreciate it really :) Show!

    > I think they are called "keys" or "launchkeys", hopeyfully, you know what I mean, but anyway they do no more work. They worked for a while, but they do not work now. I went into the control panel and went into the 'Toshiba' orders and tried to change what does each control, but it still does not work. No one knows how to fix?

    The Toshiba Satellite M100. M100-JG2 seems to be a Canadian series laptop. I recommend you to visit the driver Toshiba Canada page and to download and reinstall the tool called controls, Toshiba HotKey Utility, touch and launch.

    http://support.Toshiba.ca/support/download/ln_byModel.asp

    > Also, another problem that I had since I first laptop is my date and time are screwed up. If I put my 15:30 time, it works perfectly, until around 16:15, that when he goes back to 15:30 and go all the way up to 16:15 and continues in this cycle until I manually change the time. I had a few friends (no professional) to look at, but can not understand. When I start my laptop I go to settings in the start screen, try to change it was from there, but it keeps going during the cycle. If I click on the time and click on the tab "internet time" and say "update now", it updates, and then only time will work normally, but only until I turn off my laptop. Once I turn it on then next turn, it passes through this new cycle of 45 minutes. If anyone has had this problem or knows how to fix?

    I think that you have changed the date and time in the BIOS. Is this good?
    If not, change it and don t forget to save the changes.

    In Control Panel--> Date and time--> time tab Internet, please uncheck the auto sync with the internet time server.
    In the other, called tab time zone please choose the right time zone and activate the tick to the option called automatically adjust the clock for an advance of changes

    See you soon

  • Internal battery / Date/time problem

    My NEX-6 will only keep the date/time information after I put it. He was dead when I got it, but after the normal battery charging to full and using the camera, whenever it is turned off, it forgets the time. I did some research online, which said it may take a while to recharge the internal battery, but I tried to charge for 24 hours straight, and using the camera frequently (as described in the manual) and doesn't seem to solve the problem.

    Once, after leaving unused for a few days, I noticed that he miraculously started saving the date correctly, even when it is off. This lasted about a week, but now he has lost the ability to keep the time again, and with the charge Jack did not set.

    Any thoughts? Apart from sending to Sony to repair?

    I tried the factory reset but that did not work. As I don't have a battery (and don't want to buy a second, in which case it is not the problem), looks like I'll need to come back for the service.

  • Synchronization in 6071e timer problem

    Hello

    I am generating two pulse train using timer PXI-6071e. My requirement is one should have 10 initial period (micro seconds) and others without any delay. When I set up and generated pulses using two timers ctrl1 and ctrl0, I found something strange! Initial delay train a pulse was 28.

    When I set the initial delay two train 0us then also pulses output gave delay 18us and it changed from time to time, means that if I stop and run again, it will pass to US 17 or 15. am I doing something wrong please take a look at VI.

    Can you suggest me a solution, I have attached the VI (labview 8.6 and 8.7 DAQ).

    Thank you.

    Many people, problem solved...

    A representative of NEITHER came to the presentation and solved the problem.

    all I have to do is trigger channels using an external trigger or internal.

  • HP Pavilion Notebook 15-ab083T: laptop upgraded before even starting for the first time = problem?

    Hello!

    I recently bought this laptop with the intention to replace the hard drive (1 TB HDD 120 GB SSD), as well as upgrading the ram from 8 GB to 16 GB. The problem is that I have improved these things before you start for the first time. And now it complains that it cannot find a device boot, even when I insert a USB key with windows 10 iso on it. Or a cd with windows XP. He needs to have the HDD windows 8.1 original in it on first commissioning? It took a while to replace parts...

    Thanks in advance.

    That's very true, I used gparted before checking this again, and it was corrupted. Very well! I ended up installing windows 10 home using a free student license. It's perfect, since I have windows 8.1 before running on the 1 TB hard drive and it was filled with bloatware, thanks to HP (no offense). So, it is nice to have a clean install. Everything works fine now, I had to change some settings of 'Legacy Boot' in the bios to boot from the USB.

  • Time problems Syncro and hp Advisor does not.

    Well, I had problems lately, and one of them goes down time syncro. I tried to make the prompt for syncro and do not work.  My computer is a HPa630f.  I keep getting some time is not well actually my time shows that it is.

    Second prob is just started coming up with the hp Advisor

    event name clr203 prob

    Siganture04 mscorlib

    signature prob system. I.O.FileLoadException

    Event Viewer.

    Activation context generation failed for "C:\Program Files (x 86) \Hewlett-Packard\HP. Load Assembly Microsoft.VC90.CRT, processorArchitecture = "x 86" publicKeyToken = "1fc8b3b9a1e18e3b", type = "win32", version = "9.0.30729.4148' is not found. Please use sxstrace.exe for detailed diagnosis.

    Application

    source of event side by side 33 id

    Hello

    Flymar01 wrote:

    Mine is HP a6530f.  I looked on my computer and it was on the list.  Mine is vista 64.  Yes internet time sorry.  I have another question which is supported right now as well.  Which would not interfere with it?

    Try a different time server. Take a read of the present. The hyperlink goes to a well written explanation of how to deal with issues of internet time.

    Kind regards
    ERICO

  • "Control transaction cannot be completed at this time" problem IPS

    Hello

    Yesterday, the module AIP-SSM-20 of the customer for the second time in the last month 5 present an error on the sensor and is just the stop sensor analyzed it package.

    When the problem is present you can access the management interface, the interface answer ICMP packet, you can event followed but just show me the same event 3, which show you below:

    evError: eventId = 1351437734660979649 = severity = error Cisco vendor

    Author:

    hostId: IPS-INTERNET-BEX-1

    appName: collaborationApp

    appInstanceId: 485

    time: ene 14, 2013 10:09:27 UTC offset =-270 timeZone = GMT-04:30

    errorMessage: operation control cannot be placed at this time

    Messages, like this one, in the category - me at sensorApp has expired - have been recorded in the last seconds of 14433 222 times.  name = errUnclassified

    Both times that this problem was just reload the sensor, then it s working again.

    My question is; Why the stop sensor analyzed package?

    Could be the ASA?

    Best account.

    It could be a problem with IPS. You have to collect show-technical support and contact Cisco TAC. Newspapers may have relevant information as to why he had stopped deep inspection packages.

    Kind regards

    Sawan Gupta

  • Error on planning time (problem)

    Hi guru,.

    I have a problem with planning time in operator ODI.

    I have a delay between the time clock in the designer and run calendar.

    For example, the designer I look 14:00. So I try to plan the work at 14:03. But the work starts at 16:03. Why?

    I tried to change the odiparams.bat in this way: ODI_ADDITIONAL_JAVA_OPTIONS: = ""-Duser.timezone = Europe/Dublin "." But nothing of.

    The server that is running ODI is crimped (UTC + 01:00) Amsterdam, Berlin; Berne, Rome, etc...

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

    The ODI version: 10.1.3.5

    S.O.: Win server Datacenter R12 2012.

    Oracle 11g

    Thanks a lot for your quick return.

    Best regards.

    Thank you all. It's the job.

    Solution: Download a JRE 1.5.0_22.

    After I changed the ODI_JAVA_HOME Variable system in this way:

  • TIMER PROBLEM! Help, please! AS3

    I have this drag and drop shape game... I have this again "try" button Reset the timer, the score and the location of movable forms and «start' button that starts the timer and like «10,9,8,7...» until she paid 0 and "try again" and "next" button will appear... my main problem is, whenever I have click the "try" button again, and then click 'Start'... my timer increment decrement State... first he "10,9,8,7.." then when I click on try again and click Start Timer will '10,8,6,4... '. then when I click on try again and again it goes "10,7,4.." would you help me on this... I want this decrement, only 1 number at the same time I have click on try twice the key... Thanks in advance

    Stop();

    import flash.events.KeyboardEvent;

    import flash.utils.Timer;

    import flash.events.MouseEvent;

    var countDownIncShapes:Number = 1;

    var totalSecsShapes = 10;

    var countDownSecsShapes = totalSecsShapes;

    var score_Shapes:int = 0;

    next14. Visible = false;

    tryAgain14.visible = false;

    var timeShapes:Timer = new Timer(countDownIncShapes*1000);

    var dragArrayShapes:Array = [square14, triangle14, circle14, rectangle14];

    var matchArrayShapes:Array = [tv, pyramid, ball, envelope];

    var posArrayShapes:Array = [{x: 1113.7, y: 205.90}, {x: 812, y: 205.90}, {x: 207.55, y: 205.90}, {x: 506.25, y: 205.90}];

    var currentClipShapes:MovieClip;

    var Shapes_startX:Number;

    var Shapes_startY:Number;

    Start_Shapes.addEventListener (MouseEvent.CLICK, startShapesdrag);

    function startShapesdrag(e:MouseEvent):void

    {

    timeShapes.start ();

    timeShapes.addEventListener (TimerEvent.TIMER, tickShapes);

    function tickShapes (e:TimerEvent): void

    {

    If (counterShapes.text is "0")

    {

    timeShapes.stop ();

    countDownSecsShapes = totalSecsShapes;

    circle14.buttonMode = false;

    square14.buttonMode = false;

    triangle14.buttonMode = false;

    rectangle14.buttonMode = false;

    circle14. RemoveEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    square14. RemoveEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    triangle14. RemoveEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    rectangle14. RemoveEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    If (scoreShapes.text > = "300")

    {

    next14. Visible = true;

    tryAgain14.visible = true;

    tryAgain14.addEventListener (MouseEvent.MOUSE_DOWN, tryAgain14_onMouseDown);

    next14.addEventListener (MouseEvent.MOUSE_DOWN, next14_onMouseDown);

    }

    If (scoreShapes.text < "300")

    {

    tryAgain14.visible = true;

    tryAgain14.addEventListener (MouseEvent.MOUSE_DOWN, tryAgain14_onMouseDown);

    }

    }

    on the other

    {

    countDownSecsShapes = countDownSecsShapes - 1;

    counterShapes.text = countDownSecsShapes;

    circle14.buttonMode = true;

    square14.buttonMode = true;

    triangle14.buttonMode = true;

    rectangle14.buttonMode = true;

    trylang.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    circle14.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    square14.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    triangle14.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    rectangle14.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    }

    }

    }

    function shapesItem_onMouseDown(event:MouseEvent):void

    {

    currentClipShapes = MovieClip (event.currentTarget);

    Shapes_startX = currentClipShapes.x;

    Shapes_startY = currentClipShapes.y;

    addChild (currentClipShapes);

    currentClipShapes.startDrag ();

    stage.addEventListener (MouseEvent.MOUSE_UP, shapesStage_onMouseUp);

    }

    function shapesStage_onMouseUp(event:MouseEvent):void

    {

    stage.removeEventListener (MouseEvent.MOUSE_UP, shapesStage_onMouseUp);

    currentClipShapes.stopDrag ();

    var indexShapes:int = dragArrayShapes.indexOf (currentClipShapes);

    var matchClipShapes:MovieClip = MovieClip (matchArrayShapes [indexShapes]);

    If (matchClipShapes.hitTestPoint (currentClipShapes.x, currentClipShapes.y, true))

    {

    currentClipShapes.x = posArrayShapes [indexShapes] .x;

    currentClipShapes.y = posArrayShapes [indexShapes] there;

    currentClipShapes.removeEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    currentClipShapes.buttonMode = false;

    score_Shapes is score_Shapes = 100;.

    scoreShapes.text = score_Shapes.toString ();

    }

    on the other

    {

    currentClipShapes.x = Shapes_startX;

    currentClipShapes.y = Shapes_startY;

    }

    }

    function next14_onMouseDown(e:MouseEvent):void

    {

    gotoAndPlay (15);

    }

    function tryAgain14_onMouseDown(e:MouseEvent):void

    {

    square14.x = 1110.15;

    square14.y = 533.75;

    circle14.x = 227,05;

    circle14.y = 541,3;

    triangle14.x = 818.85;

    triangle14.y = 537;

    rectangle14.x = 506.30.

    rectangle14.y = 529.85;

    score_Shapes = 0;

    scoreShapes.text = "";

    counterShapes.text = countDownSecsShapes;

    tryAgain14.visible = false;

    next14. Visible = false;

    timeShapes.reset ();

    Start_Shapes.addEventListener (MouseEvent.CLICK, startShapesdrag);

    }

    If you are out of the frame that contains the button of your Start_Shapes you will need to add this listener each time you come back on the frame with _Start_Shapes.

    Thus, it may be your timer listener that is causing the problem.  and when I checked I see a known problem: you're nesting functions named.  never do this:

    function startShapesdrag(e:MouseEvent):void

    {

    timeShapes.start ();

    timeShapes.addEventListener (TimerEvent.TIMER, tickShapes);

    function tickShapes (e:TimerEvent): void

    {

    .

    .

    .

    }

    }

    should be

    function startShapesdrag(e:MouseEvent):void

    {

    {if (! timeShapes.hasEventListener (TimerEvent.Timer))}

    timeShapes.addEventListener (TimerEvent.TIMER, tickShapes);

    }

    timeShapes.start ();

    }

    function tickShapes (e:TimerEvent): void

    {

    .

    .

    .

    }

  • Time problem PE7 chronology and sharing

    I have compiled a video which, on the timeline, watch as 9 minutes 42 seconds, but when I try to share the compiler says 14 minutes long (too long for You Tube).  Why is there a difference between these two?  If I look at the chronology carefully, I see a 'ghost' that runs longer than the video and is roughly the same as what the compiler tells me will be both downloaded, but I can't find something that causes expansion and Parliament leaves me not to do anything with it - is it related to my problem.

    Then, when I divide the video into two parts, with one being 7 minutes and the other about 3, the compiler did not recognize that I have reduced the video - still shows the same (too long) I've seen in the first attempt.  Any ideas why this happens?

    Any help appreciated.

    Looks like you have a stray video or audio frame out to 14 minutes... you may not be able to see that he is perhaps too short. Try to hit the Page down key, this will move the time indicator current (ICT) along the timeline to the beginning and end of each clip. Fact it jump out of 14 minutes... If yes zoom in and see if you can see anything on any of the tracks in this position.

    Also, is the work area bar (WAB), the gray bar above the timeline, stretched to 14mins, if there is no stray clips then maybe you just dragged out the WBA to 14mins. If so just bring him back so that it covers just the video.

  • date and time problem

    If I put the date and time in A cell and the time and date in the B cell that is two days later, how to calculate the total number of hours in the cell C.

    Here's one way:

    The C2 formula is:

    = DUR2HOURS (B2−A2)

    The result is in decimal hours.

    You can also just B2 - A2 and format to display hours and minutes if you wish;

    SG

  • Windows 7 and Wow (World of Warcraft) big time problem (logs out of wow and my internet)

    Hi I have a problem when I go in the world of warcraft after 30 seconds later, I get disconnected not only Wow, but on the internet and I can't understand why does. So what I did was to look on the fourms to warcraft and couldn't find a solution to my problem, so I tried to combine my local connection and my wireless connection make jumper but I get a message saying "an unexpected error occurred while configuring the network bridge." I use a wireless router but I do not have a cause of Wired internet cables will not reach my room. the router I use is NEXT Max range model Netgear Wireless-N Router WNR834B v2 and the usb adapter that I use for this router is brought Max NEXT Wireless USB Adapter WN121T. I recently received this new hp computer which has windows 7 64-bit on it and I really want to play because of wow I just put a sheet in): anyway hope to hear from someone

    Sounds like it might be related to the same problem I have, the two thing I did her seemed to help was to disable ipv6 (click the icon at the bottom right of your screen network, click on "Network and sharing Center", then click on LAN or wireless network, you must do two of them IMO.  Once you have done this, click 'Properties', then click to clear the check in the box for "Internet Protocol version 6" and then select "internet protocol version 4", and click Properties. "  Then click on the button "Advanced".  Once you have done that click on the tab "wins" and below, it will be 'net bios settings' and click on one to disable.

  • File modification date/time problem

    Hello

    I'm trying to use file of a file modification date/time to fix a system of synchronization between a blackberry and a PC. However, the date/time of the file is not updated as I expected.

    The following occurs:

    -Using a program, a file is modifidied to make more than 100 bytes.

    -> When checking for windows Explorer (using the mass storage mode to access the file) the change date is updated

    -Using the same program, the file is changed to be the shorter of 50 bytes.

    -> When checking for windows Explorer, the change date is NOT updated

    -Using the same program, the file is modified to be more than 20 bytes.

    -> When checking for windows Explorer, the change date is NOT updated

    -Using the same program, the file is modified to be more than 100 bytes. It is now longer that he has never been.

    -> When checking for windows Explorer, the change date is updated

    The code that updates the file is basically something like this:

    FileConnection connection = (FileConnection) Connector.open (fileName, Connector.READ_WRITE);        {if (!) {(Connection.Exists ())}
    Connection.Create ();
    }
    OutputStream out = connection.openOutputStream ();
    Output PrintStream is new PrintStream (out);.
    output.println ("a lot of text ');

    Various printlns... followed

    output. Close();
    out. Close();
    Connection.Close;

    I use a v4.5.0.55 8310 platform, 2.7.0.68.

    BlackBerry JDE 4.5.0.7

    Any ideas what's wrong?

    Kind regards

    Anders

    Yes, delete the file is kind of a workaround. Last updated date/time will be correct. Created date/time will be of course lost, however, since the time created is generally much less important that her last updated date/time is better.

    I ended up doing the following whenever I change a file of Java code:

    FileConnection connection = (FileConnection) Connector.open (fileName, Connector.READ_WRITE);

    {if (Connection.Exists ())}

    Connection.Delete ();
    }
    Connection.Create ();

    Thank you

    Anders

  • Apply time problem

    Hi all

    In our productiuon DG (GR 11, 2) configuration, log shipping is fine, but apply in real time is not active. Only newspapers have been shipped and applied to the log command.

    While we wonder status of the newspaper from the day before was the end UNASSIGNED status the main and backup databases.

    SQL > select group #, archived, status from v$ standby_log;

    GROUP # ARC STATUS

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

    11 UNASSIGNED YES

    But when ourselves and see the real-time status query that it showed that apply in real time is activated.

    SQL > select nom_dest, status, type, srl, DEST_ID, recovery_mode from v$ archive_dest_

    situation where dest_id = 1;

    DEST_ID NOM_DEST STATUS TYPE SRL RECOVERY_MODE

    APPLY 1 LOG_ARCHIVE_DEST_1 NO. MANAGED IN TIME VALID LOCAL REAL

    But still to the UNASSIGNED State. Please let me know if I should change any value of parameters.

    How do primary groups?  Not standby redolog groups must be (not group redolog) + 1. Why did you create a single group of newspaper pending?

    Apply real-time does not work if you have less number of standbylog groups as recovery changes must be written to standbylogs while they are written on the redolog members.

  • Reminder Menu render time problem

    Hello world. I hope that someone could help or explain why I seem to have this problem.

    I'be created a project in Encore with 2 motion menus.

    They have so far taken 12 hours just make menus.

    Can anyone think why?

    The menus have 4 boxes image of each with queries of the chronology of the main movie and a piece of music playing on a continuous loop.

    I have Encore CS6 in the context of the penal code

    The computer is a standard MacBook Pro using OS Yosemite at the end of 2011.

    Is the only program running again.

    Anyone with advice or explanations, I would be happy to hear from you.

    Thank you

    It is possible that permissions in Yosemite are creating a problem. But it would be more likely that something does not work rather than hang on to this stage.

    If the audio for the loop is long, it also renders very long video, even if you video is not. I'd also look at this length. Try a short audio or video to see only animation menu if it works.

Maybe you are looking for