{ "id": "64097", "key": "TIMOB-3465", "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": "11362", "description": "Mobile 1.8.0 M09", "name": "Sprint 2011-30", "archived": true, "released": true, "releaseDate": "2011-08-01" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-07-27T09:22:59.000+0000", "created": "2011-04-15T03:45:31.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "reported-1.6.1", "tooling", "xml" ], "versions": [ { "id": "11260", "description": "", "name": "Release 1.6.2", "archived": true, "released": true, "releaseDate": "2011-04-20" } ], "issuelinks": [], "assignee": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-08-26T16:15:19.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}
On Android, If parseString is only defined inside an event\r\nlistener then you will get an error.
This only happens until you define it outside of the\r\neventListener once. After that it will work fine in that\r\napplication even if it is inside an event listener. In order to\r\nreproduce this error you MUST create a new application.
\r\nStep 1: Create a NEW application
\r\nStep 2: Paste the example below into app.js
\r\nStep 3: Run the app
\r\nStep 4: Click 'Find Foo'
\r\nStep 5: Notice Runtime Error (picture of error attached)
\r\nvar xmlString = '<items><foo>FOO</foo><bar>BAR</bar></items>';\r\n\r\nvar window = Ti.UI.createWindow({\r\n backgroundColor: 'green'\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n title: 'Find Foo',\r\n height: 60,\r\n width: 100,\r\n top: 40\r\n});\r\nbutton.addEventListener('click', function(e){\r\n var xml = Titanium.XML.parseString(xmlString);\r\n var element = xml.getElementsByTagName(\"foo\");\r\n Ti.API.info( element.item(0).text );\r\n});\r\n\r\nwindow.add(button);\r\nwindow.open();
\r\n
\r\nTiSDK 1.6.1, Android SDK 2.1