Skip to first unread message

Apx

unread,
May 4, 2019, 10:49:35 PM5/4/19
to mitappinv...@googlegroups.com

good night,

we know that in the question of blocks related to screen,
we have the option to configure the "back" button of the device,
as an example, to close the application,
but what if, by chance, the user press the home button? which in theory would have to leave the app in the background,
how do I stop the application at that time,
as I have a case where the app goes to the background, but everything inside it keeps happening

Ghica

unread,
May 5, 2019, 9:09:42 AM5/5/19
to MIT App Inventor Forum
App Inventor cannot run in the background, therefore you should use another tool if your app relies on that.
If you just want to save your work when the user tries to exit, you could make sure that all information is always saved in a TinyDB and that you restore this information on startup (Screen1.Initialize) of your app.
Cheers, Ghica.

Apx

unread,
May 5, 2019, 11:28:25 AM5/5/19
to MIT App Inventor Forum
but that's exactly what's happening, it's running in the background, and I want it to not work,
if by any chance I end up pushing the device's home button, it minimizes the app and everything inside it still works
if it is scheduled for after a certain action, call another screen, even with the app closed,
or in any other application on the phone
it ends up calling the created app to the foreground again

Taifun

unread,
May 5, 2019, 6:24:58 PM5/5/19
to MIT App Inventor Forum
as an example, to close the application,
but what if, by chance, the user press the home button?

you might want to try the ActivityStateChanged event from the tools extension like this

if state = stop
then close application

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

Apx

unread,
May 5, 2019, 9:12:25 PM5/5/19
to MIT App Inventor Forum
Thank you very much, I was able to solve using your tool


att
Reply all
Reply to author
Forward
0 new messages