×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    13

    Application not responding to exit_key_handler

    Code:
    # set default access point
        retries = 5
        while retries:
            try: 
                socket.set_default_access_point(u'IDEAS Internet')
                e32.ao_yield()
                break
            except: 
                addLog("Unable to establish connection")
                timer.cancel()
                e32.ao_yield()
                timer.after(2)
                retries = retries - 1
                addLog("Retrying..")
    appuifw.app.exit_key_handler = quit_app
    If i happen to not have a sim card inserted, I will basically be in the loop for 5 times before it exits. However, I want to exit immediately upon pressing the right softkey, which will basically call upon "quit_app"

    But in reality, i've been mashing the softkey like mad and the phone is not responding. Code is tested on N96 and N97. Any ideas what's wrong?

  2. #2
    Registered User
    Join Date
    Jul 2010
    Posts
    13

    Re: Application not responding to exit_key_handler

    I'd like to add that if i were to kill it using the standard task manager, the whole phone reboots.

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Application not responding to exit_key_handler

    hmm are you testing the application in the shell or as a sis file???

  4. #4
    Registered User
    Join Date
    Jul 2010
    Posts
    13

    Re: Application not responding to exit_key_handler

    The application was run as a sis file

  5. #5
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: Application not responding to exit_key_handler

    Hi, manpacker

    Quote Originally Posted by manpacker View Post
    Code:
    # set default access point
        retries = 5
        while retries:
            try: 
                socket.set_default_access_point(u'IDEAS Internet')
                e32.ao_yield()
                break
            except: 
                addLog("Unable to establish connection")
                timer.cancel()
                e32.ao_yield()
                timer.after(2)
                retries = retries - 1
                addLog("Retrying..")
    appuifw.app.exit_key_handler = quit_app
    Where is define quit_app() in your code ?

    You should write the below way.

    Code:
    #Define the function to be called when the right softkey is pressed
    def quit():
    	app_lock.signal()
    	appuifw.app.set_exit()
     
    #Set it as the right softkey's function
    appuifw.app.exit_key_handler = quit
    Best regards,
    RaHuL

  6. #6
    Registered User
    Join Date
    Jul 2010
    Posts
    13

    Re: Application not responding to exit_key_handler

    Here is the definition:
    Code:
    def quit_app():
        timer.cancel()
        applock.signal()
        sys.exit()
    I remembered once when i shifted the e32.ao_yield(), it could quit properly. But after some code changes, it stopped working again..

Similar Threads

  1. How to kill an Application which is not responding in 5800 due to absence of 'C'
    By kamaljaiswal in forum General Development Questions
    Replies: 5
    Last Post: 2009-11-21, 07:16
  2. redefining exit_key_handler
    By foosion in forum Symbian
    Replies: 1
    Last Post: 2009-08-12, 14:14
  3. Softkey text: appuifw.app.exit_key_handler
    By bacademy in forum Symbian
    Replies: 1
    Last Post: 2007-09-13, 05:36
  4. Application not responding...
    By sujith in forum Tools and SDK Feedback (Closed)
    Replies: 1
    Last Post: 2006-11-07, 06:31
  5. closing Form dialog without exit_key_handler
    By vipul.mobiance in forum Symbian
    Replies: 1
    Last Post: 2005-12-21, 14:34

Posting Permissions

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