Search Issue Tracker

Won't Fix

Votes

0

Found in

2018.4

2019.4

2020.1.11f1

2020.2

2021.1

2021.2

Issue ID

1313841

Regression

No

[Mobile] Android apps do not call Application.wantsToQuit

Mobile

-

How to reproduce:
1. Open the attached "Repro1313841.zip" Project
2. Switch to Android and Select "Development build" in Build settings
3. Build and run the SampleScene on an Android device
4. Touch the "Quit" Button

Expected Behavior: The developer console appears with the message "Quit intercepted"
Actual Behavior: The app quits

Reproducible with: 2018.4.31f1, 2019.4.20f1, 2020.2.4f1, 2021.1.0b7, 2021.2.0a4

Reproducible devices:
VLNQA00286, Meizu - (PRO 5), Android 7.0, CPU: Exynos 7 Octa 7420, GPU: Mali-T760
VLNQA00335, Samsung Galaxy S20+ 5G (SM-G986B), Android 10, CPU: Exynos 990, GPU: Mali-G77
VLNQA00310 iPad Pro 12.9 1st gen (iOS 13.4.1)

Note:
- Could not reproduce on Windows Standalone

  1. Resolution Note (2021.2.X):

    Delving deeper into the issue revealed that "wantsToQuit" and "quitting" events on Android platform (when app is closed from OS side) was broken even before regression mentioned above or never properly worked at all. Looking deeper into this issue showed that on Android platform application has limited time to execute (when it's being killed by OS) and sometimes required code is not executed at all (in case app was suspended for longer period of time). This means that these callbacks sometimes might not be called or might be interrupted before execution finishes therefore there is not much sense to add them now.

    Documentation team was contacted to help update "wantsToQuit" and "quitting" callbacks behaviour on iOS and Android platforms information.

    Both platforms in their official documentation states that the best practice to save application state is when app loses its focus rather than when exit code is executed therefore it is recommended to design application architecture having callbacks such as OnApplicationPause in mind.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.