New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(android): Ti.App wrongly fires pause/resume events when opening/closing child windows #10634
Conversation
…ume events when opening/closing child windows - Updated Ti.App docs to indicate Android supported these events since 7.5.0
|
// If no activities have been started, then app is going to be put into the foreground. | ||
if (this.activityCount == 0) { | ||
// Fire Ti.App resume events. | ||
KrollModule appModule = this.tiApp.getModuleByName("App"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also put appModule
in TiApplicationLifecycle
, so we don't have to grab it each time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that we add a new "App" module instance every time a new JavaScript runtime gets created (ie: back-out of the app and relaunch).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: PASS
I was verbally told that iOS fires a "pause" event when an alert gets displayed. I'm going to double check. (Not sure if I agree with this behavior, but app devs might be designing around this.) Edit: |
The 'resume' and 'resumed' events are fired on app launch, and app foreground. They do not get fired when a window is opened. However there is a slight difference between android and iOS related to events fired during app launch. On iOS only 'resumed' event is fired whereas for android both 'resume' and 'resumed' events are fired. |
… "pause" like iOS
Update PR so that a "resume" event only gets fired after a "pause" event (like iOS). You will no longer see a "resume" event on app startup... but you will still see a "resumed" event (with a 'd') on app startup. |
- Changed "TiApplicationLifecycle" class' static variables to instance member variables. They don't need to be static.
Can this be merged soon? I see the PR is approved since a while. Thx! |
FR Passed. |
JIRA:
https://jira.appcelerator.org/browse/TIMOB-26746
Summary:
Ti.App
docs to indicate Android supported these events since 7.5.0.ProcessLifecycleOwner
Java classes until the Titanium SDK can be built with gradle. This is because we need to use Google's lifecycle compiler JAR to handle its annotations. (Alternatively, we compile with Java 8, but then we could have a potential min Android OS version issue.)Test: