detect when activity is currently visible or opened...
-
im building and app that play audio on device but had two plans. premium and regular, basically premium allow you listen music with app closed on background but i dont know how detect when app is closed or isn't visible, when you close app, this still playing audio on device... only found a way to detect when user press back button with this:
Connections { target: Qt.application onAboutToQuit: { console.log("back_button_pressed"); audioPlayer.stop() } }but if the user close the app with button to see apps running, the app still playing audio.
so... is there a way to detect when app is closed or isn't visible, something that can help me detecting when user close the app.
-
I think this thread has a fitting answer to your issue: https://forum.qt.io/topic/58483/solved-detect-when-app-is-sent-to-backround-on-android/2