You Are Here:

Community: Developer Discussion Boards

#1 Old Correctly pause and resume MIDlet? - 2002-07-29, 10:24

Join Date: Mar 2003
Posts: 2
Terol
Offline
Registered User
How to correctly pause and then resume midlet? Example code and articles are welcome!
Reply With Quote

#2 Old RE: Correctly pause and resume MIDlet? - 2002-07-30, 08:01

Join Date: Mar 2003
Posts: 231
Location: UK
LongSteve
Offline
Regular Contributor
Hi,

The MIDlet class has two methods which you override in your own class, startApp() and pauseApp(). All you need to do is to have a boolean flag (called paused maybe) which is set to false in startApp() and true in pauseApp(). Then, depending upon what your midlet does, you simply check the flag and don't do it if the midlet is paused. A game midlet for example would stop it's timer and not perform any tick or render calls if it was paused.

You can also use the pauseApp() and startApp() as handy places to put your save/load code too, using the rms store for example.

This is the theory in any case, you'll find that some phones don't call these methods when you think they should. The 3410 for example seems to never call pauseApp(), so you have to find something else to trigger you game pause, or save, or whatever. It all ends up being a bit hit and miss really!

Hope this helps,

Steve
Reply With Quote

#3 Old RE: Correctly pause and resume MIDlet? - 2002-08-05, 07:25

Join Date: Mar 2003
Posts: 3
c_s_a_b_a
Offline
Registered User
Hi Steve,

If MIDlet.pauseApp() and MIDlet.startApp() does not work for you, you may still have a chance with Canvas.hideNotify() and Canvas.showNotify().

Csaba
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia