Pausing works differently on different handsets.
For nokia you can only detect a call if the display is set to an instance of Canvas.
hideNotify() and showNotify() will be call.
Be aware: these methods are call at other times as well though.
For most phones (but not nokia or samsung), the midlet methods startApp() and pauseApp() will be called.
On samsung phones (well E710 anyway), nothing is called, the running java virtual machine is just suspended.
Samsung phones require your game to have a special hack if you use System.currentTimeMillis() in your game.
The reason for this is, while the game is suspended, time continues to pass, and once the game is resumed, the time as reported by System.currentTimeMillis() will jump by the time the game was suspended. If like me you use System.currentTimeMillis() for timing/speed control of your game, this will kill it.
The solution is to use a virtual time function, this solves several problems (e.g. how to pause the game) in one swoop.
My time function is below:
// notes: #ifdef is a cpp (C preprocessor) directive.
// notes: GetGameTime() must be called at least once a frame.
private static long gameTime;
private static long gameTime_lastCall;
public static long GetGameTime()
long iCurTime = System.currentTimeMillis();
long iTimeJump = iCurTime - gameTime_lastCall;
// if time skip of 3 sec or more, then pause
if (iTimeJump > 3000)
// if not paused than increment time
gameTime += iTimeJump;
// this must be updated every time, if it is not updated
// when paused, time will jump when you unpause
gameTime_lastCall = iCurTime;