How to get a TimerTask program itself?

I'm trying to run a TimerTask to repeat at irregular intervals.

that is when the TimerTask is running, it calculates the next interval, cancels, then attaches to the new interval.

Like this:

_runTimer = new TimerTask() {
    public void run() {
        _runTimer.cancel();
        int next = program[step];
        timer.schedule(_runTimer, next);
        step++;
    }
};_runTimer.run()

Except that it explodes with IllegalStateException on the row of the table.

So if a TimerTask cannot plan itself, is there another model of how to do?

Thank you

If you want your TimerTask to run at irregular intervals, you can create a custom class that extends and create instances of it to the list.

Timer timer = new Timer();

private class RunTimer extends TimerTask {
   public void run() {
      int next = program[step];
      timer.schedule(new RunTimer(), next);
      step++;
   }
}

_runTimer = new RunTimer();

timer.schedule( _runTimer(), program[step] );
step++;

Tags: BlackBerry Developers

Similar Questions

  • Satellite A200-AH7 - how to get the camera program?

    I installed Windows 7 today and now the Chicony Webcam does not work. I've updated the drivers and the software for the Toshiba for Windows 7 download site, but nothing happens when I click on camera assistant. I tried to run the compatibility program, and he tells me that the program is not compatible even tought that the software is for Windows 7.

    Any ideas on how to get the camera to run program?

    Thank you
    Gary

    Sorry my mistake, the camera assistant was hidden.
    Of work.

    Post edited by: gary blainville

    > Sorry my mistake, the camera assistant was hidden.
    > Work.
    This means that your webcam working properly now?

    If so it of great and thanks for your comments! :)

  • Meeting place for Dell 7 - How to get with the program?

    I tried to read the posts on this site and I'm more afraid of the answers have not the knowledge of the use of the English language.  The question is this:

    I can't move my apps on the SD card in the 87 venue, but I can't on my Samsung Galaxy S3.  Thought Android was open architecture?

    I discovered exactly how? (Preferred link)

    Where can I find the contact details of the Android Dell team and get the truth about what is really happening?

    Thanks in advance for your attention in this matter

    Go into settings--> apps.  Select an application.  If there is a button that says "move to SD card" touch. Your application moves.   If there is no option button is not available.  Apps can not be moved.  I have a place 8 running 4.3 and apps on the sd card is not available for it.  I doubt that you have it on the 7.

    "Apps on SD card" apps do not actually add this funtionallity.  They only find mobile applications, then you can reach the settings app. Where you can press that "move to SD card" button.these 'move' apps are just a convenience.   You must have this available in configurations for her to work.

    There are ways to do it if you root your device.  But in my opinion, it is not worth.  Just be selective of the apps that install.  Install only the ones you actually use.  Store other files like music, photos and videos on the SD card.

  • How to get all the programs in the Start Menu is displayed as a cascading menu

    Is there a legitimate way to get the menu all programs in the Windows 7 Start Menu to display a menu cascading (WinXP style)?

    I've seen many references to various malicious programs to download from the internet who hack into the start menu to provide this functionality, but I'm not interested in executing random programs from the internet.

    If there is no legitimate way to do this in Windows 7 right now, is it possible to add this in the future Microsoft? The current implementation of menu "scroll of the trees" is really annoying. :-(

    Is there a legitimate way to get the menu all programs in the Windows 7 Start Menu to display a menu cascading (WinXP style)?

    I've seen many references to various malicious programs to download from the internet who hack into the start menu to provide this functionality, but I'm not interested in executing random programs from the internet.

    If there is no legitimate way to do this in Windows 7 right now, is it possible to add this in the future Microsoft? The current implementation of menu "scroll of the trees" is really annoying. :-(

    Hi Ghaz78

    There is unfortunately no way to do this without using a replacement of the third party.

    One of the most popular workarounds must simply turn on the Quick Launch bar. You can put the toolbar QL next to the Start Menu and then copy the folder of programs (all programs) on this toolbar that will give you the cascading effect.

    See the post below for the steps to add the QL toolbar.

    Bar to complete tasks

    Once this done, go to Start, then right-click all programs , and then selectopen all users. This will take you to the folder C:\ProgramData\Microsoft\Windows\Start start\program . This is the location where the shortcuts that appear in all the user accounts, theall programs folder.

    Copy this folder in: C:\Users\your name\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch

    Go toStart, all programs right click and select Open. This will take you to the
    Record of C:\Users\your start\program name\AppData\Roaming\Microsoft\Windows\Start.
    This is the folder where shortcuts that appear only in the all programs to your specific user account folder is located.

    Copy this folder in:C:\Users\your name\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch

    Quite.

    I hope this helps.

    Thank you for using Windows 7

    Ronnie Vernon MVP
  • How to get back the programs that I have this marking of the beginning of the user interface modern Windows 8?

    I accidentally this marking of some programs at the beginning of the modern user interface. Though even they do not show on the start menu, windows store updates offers up-to-date on them without worrying. Can someone tell me how I can back these applications?

    Thank you. :)

    This is how...

    1. Right-click on the Start Menu
    2. Select "All Apps"
    3. Scroll to find the "missing" app
    4. Right click on it
    5. Select "Pin Code on startup"
  • How to get 2 monitors program?

    Hello

    So I use the reference monitor to check exposure and color and what not, but the reference monitor does not show a live stream during playback. It doesn't show me my references when I stop reading the Premiere Pro sequence. Elsewhere CS6 using.

    So, I learned that my scopes can also be displayed in the program monitor, but then I can't see my pictures.

    There is no way of reading my images AND see scopes and direct waveforms? This is getting really frustrating for me. Or a way to get 2 program monitors so I can create one in all scopes and the other to composite video?

    Thanks in advance!

    Chris

    as Steven already wrote above:

    If you have two monitors, go in edition / preferences / playback settings and check the box next to your second (or third) monitor.

    He also had a screenshot in his post...

  • How to get laptop PC programs.

    Hello

    I understand that you can not transfer programs from a PC (Windows XP) to a laptop / Tablet (area 3), unless you use a flasf drive. But what a particular program files you copy so it opens on the laptop? In particular, I want to export my iTunes library and eGames Solitaire program. There seems to be a lot of files, but which will make the programs work?

    Thanks for any advice,

    Dave.

    The game may 14, 2015 12:53:08 + 0000, DaveBryant21 wrote:

    I understand that you can not transfer programs from a PC (Windows XP) to a laptop / Tablet (area 3), unless you use a flasf drive. But what a particular program files you copy so it opens on the laptop?

    With an occasional exception, you cannot transfer any programs
    computer to another. This is because almost all programs have
    components and references that are scattered across the disk in the
    Registry and elsewhere. If you a program on another computer, you must
    to reinstall its original media.

  • How to get back the PROGRAM area?

    The PROGRAM CS5 box went off my screen. Unfortunately, I tried to create a new workspace, and now I can't RESET the current work space to return to what I had which was a basis in place of SOURCE-PROGRAM-PROJECT and TIMELINE.

    Hope that someone can help me here because I can't move forward until this has been resolved. Thank you. Janice

    Go up to the window / workspace workspace reset or choose one of the standard working spaces, if this does not work:

    Hold down the shift + alt key while opening the first up to the Welcome screen.

  • How to make revisions to program? How to get these automatically?

    I don't know when the changes/updates are available, or how to get the updates of the program. Is there a setting to automatically download updates

    The manual control is under the selection Help-about Thunderbird .

    For auto options go to the menu bar and select Tools-Options-Advanced-update

    No menu bar tools showing? Press the alt key to make it appear.

  • How to get a program all the list of the names of the values in a registry key?

    Hello

    How to get a program all the list of the names of the values in a key of windows registry without having to configure the number of values in the key?

    Thank you & best regards

    Samuel J

    Hi Samuel,.

    you will get this info from "Query registry key Info.vi".

    Mike

  • I don't have the money to buy more ram, how to remove programs to get more memory and how do I know which programs remove

    I need of more memory, I can't afford to buy it, how to remove stuff to create more memory and how do I know what programs are ok to remove

    I think you're confusing terms and certainly confuse us.

    RAM/memory (they are identical) is the memory on the computer that is used by programs running as a temporary store for data.  How to reduce the amount of memory used is to close unnecessary programs or does not work as much.  for example close the browser and your e-mail so that the execution of Word program.  You do not need to uninstall programs, run just not, to save memory.

    IF you talk about not having enough disk space to store your programs and data, then the way to increase the free space on the disc IS to uninstall unnecessary programs - only you can decide what programs you don't need.  One way to increase disk space is to make sure you have emptied your Recycle Bin to delete the old data files, you don't want to, and uninstall programs.

    You need to tell us exactly what error messages you get so that we can determine what your problem is.

  • How to get a program to uninstall game

    How to get a program to uninstall game

    See if this helps:-

    http://www.ComputerActive.co.UK/CA/download-review/2040736/remove-unwanted-software-Revo-Uninstaller-19

  • my file were gone in all menu programs start but it still usable in the c drive... Why? and how to get back to normal

    my file were gone in all menu programs start but it still usable in the c drive... Why? and how to get back to normal?...

    its empty in all programs but available to the c drive... can someone help me? /

    The elements of the start menu are a few shortcuts to the files on the C: drive you mention.  Done that caused all the elements of Start Menu to disappear?  This is sometimes caused by viruses that hide items on the computer, make sure that the computer is virus free, run a Malwarebytes scan on the machine.  If the machine is free virus that then I suggest that you do a system restore to a point just before the problem started.

    John

  • Cannot access Internet and all programs on the start menu. How to get rid of a virus on windows xp

    I was recently given a hand computer (compaq I tthink) so I'm not clear about all the fancy stuff to the extent of the ect CPU... but I know it has windows xp pro. in any case, a friend used my computer and for some reason any felt the need to download a program called 7-zip. Now, my computer is screwed... In the start menu > all programs, everything has disappeared! And I can access the system restore in normal boot and safe mode, but the window remains empty, we never really gave me the opportunity to use it. Oh and I can't get online in normal or safe boot mod either, what can I do?

    Original title: how to get rid of a virus on windows xp proremove a virus from windows xp pro

    Hello

    1. Why do you think that the computer is infected with the virus? See you pop - unwanted ups or odd behavior of all programs?

    2 have you made any changes to the computer before the show?

    3. did you run any online scanners to remove infections?

    4. What is the antivirus installed on the computer program?

    Method 1: Run a scan antivirus on your computer.

    www.Microsoft.com/Security/Scanner

    Note: If infections are detected during the scan, there is a risk of data loss because infected files will be deleted.

    Method 2: Safe mode with networking

     

    Step 1: Check if you can browse the Internet with success in Mode safe mode with networking.

    Networking Mode safe mode starts Windows in mode safe mode and includes the network drivers and services needed to access the Internet or other computers on your network.

    A description of the options to start in Windows XP Mode

     

    Step 2: Put the computer in a State of boot is a way to know which application is causing this problem.

    To help resolve the error and other messages, you can start Windows by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    Put your boot system helps determine if third-party applications or startup items are causing the problem. If so, you need to maybe contact the manufacturer of the program for updates or uninstall and reinstall the program.

    Step 1: Follow the steps in the link below to do the same thing:

    How to configure Windows XP to start in a "clean boot" State

    Note: After troubleshooting, be sure to set the computer to start as usual as shown here:

    Step 2: To configure Windows to use a Normal startup state

    After you have used the boot is a way to solve your problem, you can follow these steps to configure Windows XP to start normally.

    1. Click Start and then click Run.
    2. Type msconfig and click OK. The System Configuration Utility dialog box appears.
    3. Click the general tab, click Normal Startup - load all services and device drivers and then click OK.
    4. When you are prompted, click on restart to restart the computer.

    Method 3:

    Create a new user account and verify if you are able to access the program in the start menu.

    Try to connect with a different user has administrator rights account and then create a new user account.

    For more information, see these links:

    How to create and configure user accounts in Windows XP

    How to copy data from a corrupted to a new profile in Windows XP user profile

    I hope this helps.

  • PhotoGallery asks for a CD, that I didn't when I open a session or perform a task. When I cancel, I get the error code 1706. How can I stop this program from trying to start?

    PhotoGallery asks for a CD, that I didn't when I open a session or perform a task. When I cancel, I get the error code 1706. How can I stop this program from trying to start?

    Hello Mark.Mac,

    Thank you for your message.  Click HERE to run the Windows Installer Cleanup utility.  Once you have run the utility of your computer restarts and the functionality test.  You can also watch in download/install Windows Live Photo Gallery HERE.  Please let us know if it did or did not help to solve your problem.
    See you soon

    Engineer Jason Microsoft Support answers visit our Microsoft answers feedback Forum and let us know what you think.

Maybe you are looking for

  • serious problem. pls help!

    some "khar khar sound is coming from at the bottom of the keyboard from my hp g6 pavillion 2231 all the time when the Lalonde is running.» What to do. I'm tired of this noise. pls help!

  • My iTunes card is redeemed and activated, but it does not allow me to buy music, why?

    My iTunes gift card has been validated, redeemed and activated for $ 25, but it still won't let me buy a song for $1.29, why?

  • definitions of CAObjHandle: stdtst.h, userint.h & cviauto.h

    When you build the application in 64 - bit with CVI 2013, I have an error on CAObjHandle that, in several files: intptr_t CAObjHandle userint.h:typedef;cviauto.h: typedef intptr_t CAObjHandle; stdtst: typedef int CAObjHandle; first files are of CVI (

  • Old Vi (version 5.1)

    Hello everyone, We have recently updated our 7 lab computer to version 8.6.1 and apparently two of our [attached] essential subVis that we used in the past, cannot be loaded. The error message indicates that its version 5.1 is too old to be converted

  • HPDM and "Device ID" problem with Citrix virtual card

    In our image, there is the Citrix "virtual" adaptor, and this seems becausing a "Device ID" conflcit with some computers. I'm sitting here, watching the HPDM to change host name and the IP address of the line of the device so that the device ID is re