×

Discussion Board

Results 1 to 7 of 7

Thread: Timer in J2ME

  1. #1
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    254

    Timer in J2ME

    how can i reset the Timer in J2ME.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Timer in J2ME

    Timer has cancel() method that
    Terminates this timer, discarding any currently scheduled tasks.
    .

    Don't know if it's what you're searching for..

    Pit

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    4

    Re: Timer in J2ME

    Problem is that it does not work.
    Specification claims that timer task is sure to be terminated if closed from within its own task but it seems to not work anyway.

    I was unable to kill repeatable timer task so i just created one and used it all over during application life.

    If someone can provide some nice example of how to kill timer 100% i would be grateful.

    G.

  4. #4
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    254

    Re: Timer in J2ME

    The problem is that once u cancel the timer the timer canot be resucheled or reused.
    My problem is that i need to devlop an apps which will be having a menu and once the menu has no events then i want a pop up to come on the screen.i have built the application uisng Canvas.
    Thanks for the reply

  5. #5
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    76

    Re: Timer in J2ME

    You can post your code here to see. Timer cancel() method is used for terminates the timer and discard any schedule task and if you want reuse the timer again you should reset the value where you stored.

    BR
    Javed

  6. #6
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    254

    Re: Timer in J2ME

    can u post the sample code how to do it.
    public void keyPressed(int key)
    {
    /*in the event handling i want to activate the timer if he waits for more than 1.5 seconds and if he again sends an event then the previous wait is cancelled and timer is set again
    */
    int move = getgameactionkey(key);
    //Timer t;
    t.Cancel();
    switch(move)
    {
    case UP:case DOWN:
    timer.schedule(mover,1000,1000);
    break;
    }
    }
    on runnning it throws an Exception Timer is scheduled or cancelled
    plz give me some idea how to solve the above problem

  7. #7
    Registered User
    Join Date
    Aug 2008
    Posts
    6

    Re: Timer in J2ME

    Quote Originally Posted by arungupta_2jan View Post
    how can i reset the Timer in J2ME.
    if u got answer for this que let me know plz

Similar Threads

  1. Crash with multiple ao_timer
    By noreli in forum Symbian
    Replies: 2
    Last Post: 2007-11-01, 06:18
  2. How can the WAP browser communicate to J2ME application?
    By hbfornies in forum Mobile Java General
    Replies: 20
    Last Post: 2007-03-02, 16:32
  3. J2ME Polish Version 1.0 RC6
    By enough in forum Mobile Java General
    Replies: 1
    Last Post: 2004-07-20, 11:25
  4. J2ME Polish 1.0 RC1!
    By enough in forum Mobile Java General
    Replies: 1
    Last Post: 2004-06-15, 02:53
  5. TinyLine SVG Minute Toolkit: Optimizing SVG for J2ME
    By girow in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-05-05, 18:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×