Page 1 of 1
suspendStack and resumeStack under Android
Posted: Mon May 20, 2013 1:48 am
by Mag
Hi all,
I'm working on an app for Android that randomly play some effects sounds, all woks well but when you use the physical Home button in the device to leave the app (instead of the Return button), the app continues to play sounds. So I wonder if there is a way to know if there is a way to know when the app is not in foreground under Android OS.
Re: suspendStack and resumeStack under Android
Posted: Mon May 20, 2013 4:47 am
by Simon
Hi Mag,
I've looked everywhere for this and I don't think it can be done currently.
I've tried all the suspend/close/focus etc.
Yeah, I made a pong game that just kept happily playing the sndfx after it was closed.
If you do find out how, please post here.
Simon
Re: suspendStack and resumeStack under Android
Posted: Mon May 20, 2013 10:40 am
by BvG
A long time ago I was taught that LC apps quit when you put them into the "background" on mobile. I don't know if that's still true, but maybe try the shutdownRequest and/or startup messages?
Disclaimer: haven't ever tested if that information was correct, and they might have changed/improved it since then.
Re: suspendStack and resumeStack under Android
Posted: Mon May 20, 2013 11:06 am
by Simon
I found that they only quit when the memory was required.
Simon
Re: suspendStack and resumeStack under Android
Posted: Mon May 20, 2013 1:27 pm
by Mag
I'm thinking that maybe we could have a workaround by try to catch the "back" and "home" (if possible) hardware buttons to learn when the app exit from foreground but this I think will open a can of worms

Re: suspendStack and resumeStack under Android
Posted: Thu Aug 22, 2013 5:09 am
by jun
Hello,
I have the same problem and I was thinking I should comment it here. Did somebody has solution for this one? And how did you do it?

Re: suspendStack and resumeStack under Android
Posted: Fri Aug 23, 2013 5:09 am
by William Jamieson
Same, really curious to find out. I know that the back button sends a message that can be intercepted, but I dont know about the home key. It would be great though.
Re: suspendStack and resumeStack under Android
Posted: Mon Aug 26, 2013 7:28 pm
by SteveTX
It is not possible currently because LiveCode devs have not implemented running services / processes. All livecode apps for mobile get suspended when they don't have focus. Want to change that? Say something here:
http://forums.runrev.com/viewtopic.php?f=6&t=16321