suspendStack and resumeStack under Android
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
suspendStack and resumeStack under Android
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.
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
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
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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: suspendStack and resumeStack under Android
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.
Disclaimer: haven't ever tested if that information was correct, and they might have changed/improved it since then.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: suspendStack and resumeStack under Android
I found that they only quit when the memory was required.
Simon
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: suspendStack and resumeStack under Android
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
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?
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?

-
- VIP Livecode Opensource Backer
- Posts: 212
- Joined: Fri Feb 01, 2013 1:31 am
- Contact:
Re: suspendStack and resumeStack under Android
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
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