Namespaces
Variants
Actions
Revision as of 07:07, 27 July 2012 by hamishwillee (Talk | contribs)

Archived:How to check if the application is in background

Jump to: navigation, search
Article Metadata

Article
Created: bogdan.galiceanu (28 Mar 2008)
Last edited: hamishwillee (27 Jul 2012)

For some programs it may be useful to know whether they are running in the background or in the foreground. This is how to check the focus state of a program (using the standard PySymbian appuifw module):

import appuifw
 
#A function that tells us the focus status of the application is defined
def foc(status):
if(status==1):print 'App is now in the foreground'
else:print 'App is now in the background'
 
#We assign the function to the focus item of the Application class in appuifw
appuifw.app.focus=foc
121 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved