{ "id": "61614", "key": "TIMOB-982", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11224", "name": "Release 1.4.0", "archived": true, "released": true, "releaseDate": "2010-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:54:52.000+0000", "created": "2011-04-15T02:40:42.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:54:52.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}
code:
\n// this sets the background color of the master UIView (when\nthere are no windows/tab groups on it)\nTitanium.UI.setBackgroundColor('#000');
\n// create tab group var tabGroup =\nTitanium.UI.createTabGroup();
\nTitanium.App.addEventListener('close',function(e)
\n{
\nalert(\"The application is being shutdown\");
\n
\n});
\n// // create base UI tab and root window // var win1 =\nTitanium.UI.createWindow({
\ntitle:'Tab 1',\nbackgroundColor:'#fff',\nbarColor:'#005298'
\n
\n});
\nvar tab1 = Titanium.UI.createTab({
\nicon:'KS_nav_views.png',\ntitle:'Tab 1',\nwindow:win1
\n
\n});
\nvar navbar = Titanium.UI.createTabbedBar({
\nlabels:[\"A\", \"B\"],\nstyle:Titanium.UI.iPhone.SystemButtonStyle.BAR,\nbackgroundColor:\"#005298\"
\n
\n});
\nwin1.setTitleControl(navbar);
\nvar scrollView = Titanium.UI.createScrollView({
\ncontentHeight: 'auto',\ncontentWidth:'auto',\ntop:0,\nshowVerticalScrollIndicator:true,\nshowHorizontalScrollIndicator:true
\n
\n});
\nvar view = Titanium.UI.createView({
\nwidth:300,\nheight:100,\ntop:20,\nborderRadius:5,\nbackgroundGradient:{\n type:'linear',\n colors:[{color:'#005298',position:0.0},\n {color:'#001d36',position:1.0}]\n\n}
\n
\n});
\nscrollView.add(view);
\nwin1.add(scrollView);
// // add tabs // tabGroup.addTab(tab1);
\n// open tab group tabGroup.open();
This is a little misleading: The callback happens, but only\nafter the program has suspended, which means that nothing is going\nto get logged. Seems like this will mostly end up being a\ndocumentation issue, provided that I can confirm that the stuff in\nthe callback is actually happening (probably via a contacts or iPod\ntest app).
\nOnce this is taken care of there will need to be some additional\ninfrastructure for 4.0's pause/resume.
Okay, much worse than I thought. There's a race between Titanium\nand the OS to see when resources get freed up: The system wants to\nrelease them immediately, and Titanium wants to try and finish\neverything up. 4.0 allows for the application to demand additional\ntime to finish tasks in the background, but allowing compilation\nfor 3.1.x (and iPad) means that app event support wouldn't work on\nthese systems.
\nInvestigating further.
Just so it doesn't slip through the cracks - this is also an\nissue on Android :)
Tag team coding. Swapping with Steve.
(from [f6e6787856b1faf7e7b71cd577b775544b25d0ee])\nWhen closing, the app now sends the close event before the rest of\nthe shutdown, and waits for the function to be processed before\nexiting. Note that it does mean if the javascript takes too long,\nthe app will be force quit like the iPhone OS would any other app.\nCloses #982 \nhttp://github.com/appcelerator/titanium_mobile/commit/f6e6787856b1f...