Page 1 of 1
How to know if the app is running in the background?
Posted: Tue Mar 29, 2016 6:33 pm
by Jellobus
Hi all,
When I launch Twitter app from the current app, Twitter app pops up and the current app will be idling and running in the background. Is there any message sent when the app goes in the background? Or Is there any walkaround to know the app is in the background?
Thanks a lot in advance!
Louis
Re: How to know if the app is running in the background?
Posted: Tue Mar 29, 2016 6:47 pm
by jacque
There is no way to know if the app is in the background on Android. Android OS will control the app, and if it does not need the RAM, the app will remain running in the background and re-open at the same state it was in before. It acts as though the user never left. But if the OS needs the RAM, it will close the app and the current state is lost.
The next time the user goes back to a closed app, it will start up all over again and get a preOpenStack and openStack message. If the app has not been closed, those messages are not sent. So you can add commands to either of those message handlers to set up your app again if you need to.
Re: How to know if the app is running in the background?
Posted: Tue Mar 29, 2016 7:05 pm
by Jellobus
Hi Jacque,
Thanks for the detailed explaination. I couldn't solve the issue but I always learn a lot from gurus like you. Again, thank you very much for your help!
Have a nice day
Louis