In my app I want it to synchronize to a DB if the user switches to it (not starting it).
I thought maybe the scene:show() could be used, but it doesn’t seem to be called when switching between apps.
I’m writing for Android (for now).
In my app I want it to synchronize to a DB if the user switches to it (not starting it).
I thought maybe the scene:show() could be used, but it doesn’t seem to be called when switching between apps.
I’m writing for Android (for now).
Never mind. Found it out on my own. You can detect app resume events like this:
local function onSystemEvent(event) if (event.name == "system" and event.type == "applicationResume") then -- Do your stuff here end end Runtime:addEventListener( "system", onSystemEvent )
Never mind. Found it out on my own. You can detect app resume events like this:
local function onSystemEvent(event) if (event.name == "system" and event.type == "applicationResume") then -- Do your stuff here end end Runtime:addEventListener( "system", onSystemEvent )