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

Android: System.exit on back button press

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.2, 6.3
    • Extras: Android
    • None
    • Android
    • 2022wk22FOQtforAndroid, 2022wk24FOQtforAndroid, 2022wk26FOQtforAndroid, 2022wk28FOQtforAndroid, 2022wk30FOQtforAndroid, 2022wk32FOQtforAndroid, 2022wk34FOQtforAndroid, 2022wk36FOQtforAndroid, 2022wk40FOQtforAndroid, 2025wk38s2QtforAndroid

      Currently, the behavior of pressing a back button is to close the app with a System.exit(0).

      First, System.exit(0) is not recommended to use and Android should be able to free resources as needed.

      • In case of Activity only and not the whole app is meant to be destroyed

      Second, this gives out some problems interacting with other activities and doesn't seem to respect normal android app behavior (stated in https://developer.android.com/guide/components/activities/tasks-and-back-stack )

      Noticied by ramon:
      Ramon Sadornil Rivera: How not to kill the entire app after a user presses back on Qt… 
      posted in Platforms / Android at 12. May 2022 10.49.56 EEST
       

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

            jani-korteniemi Jani Korteniemi
            samuelmira Samuel Mira
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes