How can I update time and show it.

I have to show the current time in a tab in my application...

my date format is hour: minute (hh: mm)

Show I want to upadte my dateField in every minute...

How can I do this... I don't want to use wire...

BlackBerry API has a RealTimeListenerinterface...

It has a clockUpdate() function

I can solve my problem with this interface...

Help, please...

Or if you know how to do it with wire you can also answer...

The RealtimeClockListener interface is the perfect tool for this.

Here is a snippet of code showing how you can use this to a DateField.  Note how the listener is added when the field is displayed and removed when it is not.  Code is not compiled, probably syntactically incorrect, but I hope you get the idea.

public class updatingdatefield extends DateField implements {RealtimeClockListener}

....

public void onDisplay() {}

Application.getApplication () .addRealtimeClockListener (this);

}

public void onUnDisplay() {}

Application.getApplication () .removeRealtimeClockListener (this);

}

public void clockUpdated() {}

final UpdatingDateField myDateField =;

UiApplication.getUiApplication () .invokeLater (new Runnable() {}

public void run() {}

myDateField.setDate (System.currentTimeMillis ());

});

}

I would avoid using timer for this.  This one uses just one wire under the covers in any case!

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • How can I test the memory on my powerbook pro

    My Powerbook Pro sometimes do strange things. Now, I would like to test the internal memory and the memory of my card.  Is there a good way to test it? In the past there where the programs official test of apple. But now it seems not to be around. Th

  • Product ID

    I need help to identify my PC model. It is said that "envy" there is no visible tag with the model # etc. "." Thank you

  • get the email addresses on to the field and paste it into the document

    I need to create a list of email addresses and my only source is an email that was sent to me.  If I type 'reply to all' I can see all the email addresses, but when I try to copy / paste into Word, the only thing that appears are the display names. 

  • Hard Drive replacemsnt and number of shared folder

    I share a folder with several subfolders between 2 computers, both running Windows XP - Pro I set up sharing so that changes in the files would be reflected on two computers - the drive on one of the computers failed although the data was recoverable

  • During the reinstallation of XP, message "Please wait" frozen and inactive computer

    Recently, I tried to reinstall Windows XP SP2 from an installation disc that came with my computer. Before reinstallation, it was under XP SP3. He went through the installation process. It appeared that the installation is complete. It restarted (for