How to quit instead of suspend on Android?



  • For various reasons, I'd really like to just quit my Android app instead of being suspended. I've tried grabbing the applicationStateChanged() signal and calling QGuiApplication->quit(), but that seems not to work.

    I've also tried to accomplish this by setting the android:noHistory property on the activity, to no discernible effect.

    Any ideas?



  • Hi,

    probably you could try exiting your app in the java code by adding your own custom activity, inheriting from QtActivity, and call finish(); in the onPause() activity callback or alternatively make a JNI-call to trigger the quit() from within C++?

    Best,
    Alex from V-Play



  • Finally got around to this again.

    Awesome suggestion! It worked!

    Not sure why QGuiApplication::quit() didn't work, but I'm super happy to be done with it. :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.