How to detect GTV back to home window or launch a new activity - google-tv

Google TV have a home button which let user come back to home window.
How to figure out it's not a new app launched? I think normally when we back to home, we can keep our app active (activity paused at this moment), e.g. keep video playing.
But if it launch a new app, we should stop video and release resources.

When your app looses AudioFocus you should pause/stop your video. Alternatively, you can just use the normal Android Activity Lifecycle, and override onPause() and then stop / pause then. You would then resume when onResume() was called.

Related

How to detect if Flutter webview is in foreground or background?

I have a requirement where I need to record the time user spends viewing a certain attachment. I am opening the item in an external webview provided by flutter_inappwebview package on pub.dev.
Now to detect the amount of time user is spending I run timers. I want these timers to stop when the app is not in foreground, so I used Flutter's lifecycle events to detect this. The problem is, as soon as the webview is opened, the lifecycle event paused is called. Now i don't know if the user is viewing the item or has pushed the app to background.
Any leads will be helpful thanks.
I tried using flutter's lifecycle events, but they fire as soon as webview is launched and does not fire any other events after the webview is opened until user comes back to the app.

How to wake an app when screensaver is displayed

I have an application that gets hidden (but is still running in the background) when the screen saver starts on the 4th Generation Apple TV.
How can I bring the app to the foreground (hide screen saver) when an event (update to an endpoint which I am long polling) happens in my app which is running in the background?
I don't think there's any way to do this. When the screen saver is running, your app can still be the foreground app, but it will be in an inactive state. This is similar to what happens on iOS when the user locks the screen while using an app. Like the iOS lock screen, the user might be actively using the system when it's in this state. For example, you can use Siri without dismissing the screen saver.

How do I force-quit an individual app on an actual Apple Watch (not in the simulators)?

When developing an app, it is sometimes useful to force-quit an application without having to re-start the entire device.
On my iPhone, I can force-quit the active app by double-clicking the home button and swiping the app to the top.
For the actual Apple Watch (not the simulators), force-quitting an app is particularly useful since there are sometimes connection problems between Xcode and the watch app. Also, sometimes I would like to force-quit my Apple Watch app when it is not connected to Xcode.
So, how can I force-quit / terminate the active app on the Apple Watch without restarting the entire device?
When the app that you would like to terminate is open:
Press and hold the side button and wait until the shut down screen appear. Then let go of the side button.
Press and hold the side button again until the home screen appears.
Your formerly active app has now been terminated.
PS: The side button is the button below the Digital Crown.

Stop the Opening of the application from the lock screen

How to stop opening up the certain application from the lock screen when the notification came
For E.G: I got the local notification from the app, when my phone was locked then I was opened the lock its automatically opening the app how do I stop it.
You cannot stop this behaviour, it's embedded into ios. If you put your device to sleep after a notification then the slide will return to slide to unlock. With the notifications showing only at the top.

Is it possible to pause my flash app on iphone by pressing home button?

I'm quite new to Flash. So here's my problem: I've created my app and it works great. But when I press home button on my iphone, my app minimizes and when I open it from multitasking apps, it simply restarts. Is it possible to freeze or pause the game instead of stop? Thanks!
By default the application should be eligible for the 'freeze-drying' iOS4+ functionality that resumes an app from the last place it left off. That may require a setting to be adjusted in your app descriptor (UIApplicationExitsOnSuspend should be false).
If you simply need to save data when the application is quitting, you can listen for Event.EXITING on the NativeApplication:
NativeApplication.nativeApplication.addEventListener(Event.EXITING, onExit);