Forum Discussion

menghao's avatar
menghao
Visitor
9 years ago

Scene Graph App quit event

Is there any way I can just block the quit event for a second? Or any walkaround? I need to detect the quit event at least. I want to log the usage to a remote server, let's say google analytics. For now, as I know, the OnKeyEvent() in the node can not detect the home button pressed. And it seems in the main.brs, the while loop that listens on the messagePort is not working either. It seems that no roSGScreenEvent has happened, the logQuit() was never called.
	while(true)
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
if msg.isScreenClosed() then
logQuit()
return
end if
end if
end while

5 Replies

  • "EnTerr" wrote:
    No, there isn't.
    This is not a scenography issue in particular - it's Roku one in general.
    There is a suggestion on how to fix that already, see here https://forums.roku.com/viewtopic.php?f ... 30#p487482
    Waiting for Roku* to chime in, I suppose. Sheesh, can't believe it's been over a year?!

    Thank you EnTerr, the way I can image is that at least I can record the time of the app quit. And try to send usage event when the app restarts next time.
    I worked on android TV the leanback library before, they all support the background activities. Hope Roku will think about it. This is a common usage case indeed.
  • "menghao" wrote:
    Thank you EnTerr, the way I can image is that at least I can record the time of the app quit. And try to send usage event when the app restarts next time.
    I worked on android TV the leanback library before, they all support the background activities.
    Umm... "background activities" is one of the big mor-asses of Android, at least for mobile. I wouldn't go there!

    Hope Roku will think about it. This is a common usage case indeed.

    Most all mobile and media platforms support exit events, indeed. In fact i can't think of one that doesn't.
    It's entirely possible Roku already implemented that a year ago, just forgot to tell us, the "little people". It has happened before (cue formatJSON(), some ECP commands, getPng()... ).
  • Have any new developments been made or discovered on this subject?