Hi, I tried to quit() the app during onlostfocus, but strangely it doesn't quit, the program is still in memory. It only quits when I goto Memory->Running Program and try to activate the Fba app. I'm using WM6, activate generally brings up a hidden app to the fore.
If quit() works, then we can programatically save state during interruption and load it back when the app is run again.
However form what I see here onlostfocus does not seem get executed immediately, so my previous code of a possible softening effect (ie attached below) has no effect? The consequence is an intensive task will continue to execute during a call interruption, hence causing phone to be sluggish and possibly not be able to take calls/need reset.
Code:
a = "apple"
b = "hasn't lost focus"
function onmainloop()
if a == "apple" then
clear(0,0,0)
print(20,20,clock(), 255, 255,255)
print(20,70,b, 255, 255,255)
end
end
function onstylusdown(x,y)
quit()
end
function onlostfocus()
a = "zero"
b = "lost focus"
end
function ongotfocus()
a = "apple"
end