| Reply | « Previous Thread | Next Thread » |
|
Is there e way to swithc my app to background without using the library appswitch?
Thanks |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
Yes, using the keypress extension. Just simulate the red (hang-up) key after telling Python not to close when this happens. Here's an example:
Code:
import appuifw, e32, keypress, sys
from key_codes import *
#Create an active object
app_lock = e32.Ao_lock()
#Define the function to be called when the right softkey is pressed
def quit():
app_lock.signal()
appuifw.app.set_exit()
appuifw.app.exit_key_handler = quit
#Define the function to be called when the red key is simulated
def myexitfunc():
s = appuifw.app.screen
appuifw.app.screen = 'large'
appuifw.app.screen = s
app_lock.wait()
#Set it as the red key's function
sys.exitfunc = myexitfunc
#Your code goes here. For example, an instance of Text
appuifw.app.body = appuifw.Text(u"abc")
#Wait 4 seconds
e32.ao_sleep(4)
#Simulate the red key
keypress.send_raw_event(keypress.EKeyDown,EScancodeNo)
keypress.send_raw_event(keypress.EKeyUp,EScancodeNo)
Still, appswitch is a lot better than doing all that ![]() |
|
i've created a python library both for 2nd and 3rd.
v3: http://www.2shared.com/file/5375674/361b6060/msys.html v2: http://www.2shared.com/file/5375651/...d/msys2nd.html msys.send_bg() -> send your app to background msys.send_fg() -> send your app to foreground |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| error PRJ0019 error while creating sis file | mrshine | General Symbian C++ | 3 | 2008-10-17 18:16 |
| How to make the background of a Custom Canvas Transparent | markchua_99 | Mobile Java General | 4 | 2008-09-30 03:57 |
| [announce] [patch] switch to background when EndKey pressed | nlsp | Python | 1 | 2007-11-15 16:45 |
| Nokia 6131 + Audio Player Background? | andrescm | Streaming and Video | 0 | 2007-10-16 00:17 |
| What is application running in background? | newnb | General Symbian C++ | 3 | 2007-01-08 04:03 |