[TIMOB-1490] Android: Race condition of Window focus/blur
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-08-20T15:45:55.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, defect |
Reporter | Don Thorp |
Assignee | Neeraj Gupta |
Created | 2011-04-15T02:54:11.000+0000 |
Updated | 2017-03-22T20:51:06.000+0000 |
Description
Not sure how to address this one. It appears that the Android OS doesn't guarantee when it will call events on activities. For example it's possible for a hidden activity to have onStart called before onStop. Or it at least appears that way. It doesn't provide. Therefore it's not possible to successfully destroy a single resource like MapView.
See http://developer.appcelerator.com/helpdesk/view/30371">Helpdesk 30371
Comments
- Keith Gable 2011-12-13
I have this problem. Focus and blur seem to only fire when the window is initially opened/closed, and not after that point. I have to synthesize focus/blur events like so:
Note that these functions are members of a map/object, which is why their syntax is sort of weird.open: function(params) { var self = this; self.win.open(params); if (Ti.Platform.name == "android") { self.focus(); // run focus callback to workaround Android/Ti issue. } }, close: function(params) { var self = this; if (Ti.Platform.name == "android") { self.blur(); // run blur callback to workaround Android/Ti issue. } self.win.close(params); }
- Junaid Younus 2012-08-20 No runnable test code and link doesn't work, ticket marked as invalid.
- Lee Morris 2017-03-22 Closing ticket as invalid with reference to the above comments.