×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    1

    Regarding Incoming Calls

    I am facing a problem in handling incoming calls in Nokia Series 40 and Series 60. I have used Hidenotify and Shownotify function . And included some flags to handle the incoming call. But the issue that i am facing is that the hidenotify and shownotify also gets called when i select menu options . And whatever action should take place when incoming call comes also takes place when select menu options. Can anyone of you help me out with this issue. Thanks in advance

  2. #2
    Regular Contributor
    Join Date
    Aug 2003
    Location
    uk
    Posts
    232

    A complete solution.

    The solution comes in two parts:

    One: only pause the game with hideNotify(), do NOT unpause it with showNotify(),
    as showNotify can be call in some very odd (and seeming wrong places).
    Leave the user to manually unpause the game after a call has finished.

    Two: In order to tell the difference between hideNotify() events you have caused
    and ones you have not you can either: use only one canvas for everything in your
    games. This way you will never cause a hideNotify(), this does mean doing your
    own menus etc as part of the same canvas (so no setting the display to a Form, or
    List etc).
    The alternative, is to mark a boolean variable whenever you are about to cause
    a hideNotify() event, and check this within hideNotify(), an example is below.
    If you do this, you must track every event you cause though, best to wrap it up
    with a function.

    Code:
    	
    	boolean bDisplayChange = false;
    	
    
    	// ------------------------------------------------------------------------- //
    	public void setDisplay(Displayable target, String name)
    	{
    		sCurrentMenu = name;
    		bDisplayChange = true;
    
    		display.setCurrent(target);
    	}
    	// ------------------------------------------------------------------------- //	
    
    	
    
    	// ------------------------------------------------------------------------- //
    	protected void showNotify()
    	{
    		bDisplayChange = false; 
    	}
    	// ------------------------------------------------------------------------- //
    	
    
    
    	// ------------------------------------------------------------------------- //
    	protected void hideNotify()
    	{
    		if (bDisplayChange)
    		{
    			// we caused this, so ignore
    			bDisplayChange = false;
    		}
    		else
    		{
    			// we didn't cause this - time to pause
    			if (Game is running)
    			{
    				PauseGame();
    			}
    		}
    	}
    	// ------------------------------------------------------------------------- //

Posting Permissions

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