| Reply | « Previous Thread | Next Thread » |
|
How to correctly pause and then resume midlet? Example code and articles are welcome!
|
|
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 |
|
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 | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|