[TIMOB-2990] Android: Window / Activity lifecycle events don't fire
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T02:00:37.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M08 |
Components | Android |
Labels | activity, android, defect, lifecycle, release-1.6.0, reported-1.6.0 |
Reporter | Marshall Culpepper |
Assignee | Marshall Culpepper |
Created | 2011-04-15T03:34:15.000+0000 |
Updated | 2011-04-17T02:00:37.000+0000 |
Description
Our current activity lifecycle events aren't being fired for activities created from a heavy weight Ti.UI.Window. JS Activities seem to work because their lifecycle seems to be the right order, specifically:
// pseudo code
public void onCreate() {
createLayout();
initCurrentActivity(this);
runScript();
fireEvent("create");
}
The heavy weight window lifecycle however looks more like:
// pseudo code
public TiUIWindow() {
startActivity();
}
public void onActivityCreated() {
// script isn't even executed until after onCreate()
initCurrentActivity(this);
runScript();
}
This is affecting a lot of our new sensor and sound API refactors that depend on pause/resume to work for correct add/remove event listener behavior.
Is this really fixed?, i downloaded the Continuous Build of Feb 2 2011 15:24 ra02f7db3 but i still have this issue. what does "Release 1.6.0 M08" mean?
(from [43ae52cacc38f22b4efa292d5ef27272560125ad]) initial refactor of TiRootActivity as a TiBaseActivity, implement better activity lifecycle support for all TiBaseActivities [#2990]
https://github.com/appcelerator/titanium_mobile/commit/43ae52cacc38f22b4efa292d5ef27272560125ad"> https://github.com/appcelerator/titanium_mobile/commit/43ae52cacc38...
(from [89ac3987ed38a4896f6147f4f416ccb4632f8332]) TiJSActivity and TiRootActivity now subclass a common TiLaunchActivity. "launch" activities have the distinction of being entry points into the application either via standard user launch, or from some other Intent. implemented a small internal message queue for launch activities so window.open() doesn't block the activity. Activities event listeners should now always receive their lifecycle events synchronously: create, restart, start, resume, pause, stop, destroy. [#2990 state:fixed-in-qa] https://github.com/appcelerator/titanium_mobile/commit/89ac3987ed38a4896f6147f4f416ccb4632f8332"> https://github.com/appcelerator/titanium_mobile/commit/89ac3987ed38...
(from [76647275afd7304f48ea8535b55a3db9e1e1f666]) moved all async / blocking callbacks to a new message queue implementation that allows single loop iteration and provides better "dispatch while blocking" behavior, fixing the vast majority of our deadlock issues. Kitchensink is now running mostly well on top of these changes. Changed setTimeout/setInterval to use handler messages instead of timer threads for better consistency. Added an intermediary TiActivityWindows class between launched internal activities and TiUIWindow for better inline notification and reaction to Activity onCreate(). fixed the weird activity indicator as widget code in kitchensink for Android. [#2990] [#2924] https://github.com/appcelerator/titanium_mobile/commit/76647275afd7304f48ea8535b55a3db9e1e1f666"> https://github.com/appcelerator/titanium_mobile/commit/76647275afd7...
(from [7996c46a2312321e35135cdc403e0ff87eafb62a]) several fixes for the new lifecycle support / message queue: async events are now fired only using Handler, as it's safe (and expected) for them to fire after the script is finished loading. TiVideoActivity now uses one less thread and doesn't block when it's handling creation arguments. new Handler based timers are now cancelling correctly, and activity indicators no longer use two separate async messages for displaying (only one is needed to sync w/ main thread). fixed a bug where changing the title of a TiUIWindow always changed it for the previous window. [#2990] https://github.com/appcelerator/titanium_mobile/commit/7996c46a2312321e35135cdc403e0ff87eafb62a"> https://github.com/appcelerator/titanium_mobile/commit/7996c46a2312...
(from [2649bb83a437f122f97c4e96671ece9b04abfae0]) retrieve the activity's current proxy if it was already created before querying a non-Activity window. [#2990] https://github.com/appcelerator/titanium_mobile/commit/2649bb83a437f122f97c4e96671ece9b04abfae0"> https://github.com/appcelerator/titanium_mobile/commit/2649bb83a437...
This was my test case, it has instructions in the label
[INFO] Titanium SDK version: 1.6.0 (02/08/11 20:55 bd9d124...) galaxy tab (2.2.2) G1 (1.6) Nexus S (2.3) sim 2.1