{ "id": "97540", "key": "TIMOB-10016", "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": "14700", "description": "2012 Sprint 25", "name": "2012 Sprint 25", "archived": true, "released": true, "releaseDate": "2012-12-17" }, { "id": "14699", "description": "2012 Sprint 25 Core", "name": "2012 Sprint 25 Core", "archived": true, "released": true, "releaseDate": "2012-12-17" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-12-05T03:07:25.000+0000", "created": "2012-07-17T22:54:40.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api", "insight", "parity" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-29T15:54:18.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": "h6.Issue\r\nCalling match() method returns a hash i.e. Ljava.lang.Object;@40528e70 that needs to be handled as an array in Android.\r\n\r\nh6.Tested on\r\niOS 5.1 simulator\r\nAndroid Razr 2.3.5\r\n\r\nh6.DDMS console\r\n{code}\r\n07-18 00:50:15.431: I/ALERT(31085): (KrollRuntimeThread) [93,93] [Ljava.lang.Object;@40528318\r\n07-18 00:50:15.431: I/TiAPI(31085): http://www.appcelerator.com\r\n{code}\r\n\r\nh6.Repro sequence\r\n{code}\r\nvar win = Titanium.UI.createWindow({\r\n\ttitle: 'Main',\r\n\texitOnClose: true,\r\n\tfullscreen: false,\r\n\tnavBarHidden: false,\r\n\tbackgroundColor: 'gray'\r\n});\r\n\r\nwin.addEventListener('open', function() {\r\n\t\r\n\tvar tweet = 'blah blah blah @YouTube. http://www.appcelerator.com blah blah - Spot 1';\r\n\textractURL(tweet);\r\n});\r\n\r\nwin.open();\r\n\r\nfunction extractURL(tweet) {\r\n\r\n\tvar urlRegex = /(http?:\\/\\/[^\\s]+)/g;\r\n\tvar URL = tweet.toString().match(urlRegex);\r\n\r\n\tif (URL !== null) {\r\n\r\n\t\t//URL found\r\n\t\talert( URL );\r\n\t\t//alert( URL[0] );//Work Around\r\n\t\tTi.API.info( URL );\r\n\t\t\r\n\t\twin.add(\r\n\t\t\tTi.UI.createWebView({\r\n\t\t\t\turl: URL\r\n\t\t\t})\r\n\t\t);\r\n\t\t\r\n\t} else {\r\n\r\n\t\talert('No URL found');\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n}//extractURL\r\n{code}\r\n\r\nh6.match Method\r\nhttps://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/match", "attachment": [], "flagged": false, "summary": "Android: match() method returns: Ljava.lang.Object;@40528e70", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Android 2.3.5 \r\nTitanium SDK 2.1.0.GA & 2.2 CI build", "comment": { "comments": [ { "id": "230023", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Match is actually returning an array, which is correct. Here, you as passing an array of Strings to both alert() and the url property for webview, which is causing this crash. In the docs, both of those properties should be strings, not arrays.\r\n\r\nThis works in iOS as a result of some internal conversion they do. There are no plans to support arrays for the properties mentioned on the Android side.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-05T03:07:25.000+0000", "updated": "2012-12-05T03:07:25.000+0000" }, { "id": "416150", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid, with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-29T15:54:18.000+0000", "updated": "2017-03-29T15:54:18.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }