Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to quit instead of suspend on Android?

How to quit instead of suspend on Android?

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 2.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rosetter
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexleutgoeb
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rosetter
        wrote on last edited by
        #3

        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. :)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved