Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-58471

Android QtService unable to stop service

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P1: Critical P1: Critical
    • 5.9.0 RC
    • 5.8.0
    • Extras: Android
    • None
    • * Android 5.1.0
      * Android API-Level 25

      If using an activity, one can stop the application by calling qApp->quit();. However, if using a service, this will not properly work, and crash the service instead!

      I tried using QtAndroid::androidService().callMethod<void>("stopSelf"); and it does indeed stop the service, but not the Qt thread, as it seems. Because if I try to start the service again, it fails with WARNING: QApplication was not created in the main() thread and tons of "already registered" warnings, and does not start.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            taipan BogDan Vatra
            SkyCoder Felix Barz
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes