{ "id": "108492", "key": "TIMOB-12412", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-05-25T04:36:50.000+0000", "created": "2013-01-24T11:36:42.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "exalture" ], "versions": [], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-07-08T23:46:15.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": "h1. Problem description\r\nThe value of Ti.Android.currentActivity.intent.className and Ti.Android.currentActivity.intent.packageName is always undefined.\r\n\r\nh1. Steps to reproduce\r\nThis simple app will print out undefined in the logs:\r\n\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar win1 = Titanium.UI.createWindow({\r\n title:'Tab 1',\r\n backgroundColor:'#fff',\r\n fullscreen: true\r\n});\r\nwin1.open();\r\n\r\nTitanium.API.info(\"Class name: \" + Titanium.Android.currentActivity.intent.className());\r\n\r\nTitanium.API.info(\"Package name: \" + Titanium.Android.currentActivity.intent.packageName);\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Ti.Android.currentActivity.intent.className and Ti.Android.currentActivity.intent.packageName are always undefined", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": "SDK 2.1.4\r\nSDK 3.0.0", "closedSprints": [ { "id": 631, "state": "closed", "name": "2016 Sprint 11 SDK", "startDate": "2016-05-21T00:06:10.029Z", "endDate": "2016-06-04T00:06:00.000Z", "completeDate": "2016-06-06T07:30:39.854Z", "originBoardId": 114 }, { "id": 618, "state": "closed", "name": "2016 Sprint 08 SDK", "startDate": "2016-04-09T00:30:18.262Z", "endDate": "2016-04-23T00:30:00.000Z", "completeDate": "2016-04-25T02:38:28.511Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "242440", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "an error is shown while running the test case\n\nUncaught TypeError:Property'className'of object # is not a function\n\njithinpv", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-15T12:19:59.000+0000", "updated": "2013-03-15T12:19:59.000+0000" }, { "id": "246689", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "As per the documentation, these are creation-only properties.", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-04-09T18:31:57.000+0000", "updated": "2013-04-09T18:31:57.000+0000" }, { "id": "377744", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~cng] can we reconsider this one? With TIMOB-19679 this has become relevant again because unless you create the intent in {{app.js}}/{{alloy.js}} you need the className/packageName of your app in order to create an alternative launch shortcut for it.\r\n\r\nSunila mentions its creation only, but that doesn't say they cannot be read.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-02-24T09:16:18.000+0000", "updated": "2016-02-24T09:16:18.000+0000" }, { "id": "379518", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "This was closed as Invalid because the properties are creation only, but that's not what the ticket is about. It is about being able to read the properties after creation, not change.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-03-11T10:13:41.000+0000", "updated": "2016-03-11T10:13:41.000+0000" }, { "id": "382576", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/7940\r\n\r\nUse this test code\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n \r\nvar win1 = Titanium.UI.createWindow({\r\n title:'Tab 1',\r\n backgroundColor:'#fff',\r\n fullscreen: true\r\n});\r\n\r\nwin1.open();\r\n\r\nTitanium.API.info(\"current activity: \" + Titanium.Android.currentActivity);\r\nTitanium.API.info(\"Class name: \" + Titanium.Android.currentActivity.intent.getClassName()); \r\nTitanium.API.info(\"Package name: \" + Titanium.Android.currentActivity.intent.getPackageName());\r\n \r\n\r\n{code}", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-04-13T08:46:53.000+0000", "updated": "2016-04-13T08:47:35.000+0000" }, { "id": "382673", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR reviewed and merged.\r\n\r\n[~fokkezb] with this fixed, which other ticket is related to this?", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-04-14T03:03:57.000+0000", "updated": "2016-04-14T03:04:16.000+0000" }, { "id": "382717", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~msamah] Thanks, with this fixed TIMOB-19679 will be easier to implement for users, but that feature is still blocked by TIMOB-20459", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-04-14T09:22:18.000+0000", "updated": "2016-04-14T09:22:18.000+0000" }, { "id": "385377", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Reverting this ticket: https://github.com/appcelerator/titanium_mobile/pull/7996\r\n\r\nA bug was introduced in this PR where if you back out of the app using the back button and enter the app again, it will crash.\r\nLine causing bug is:- \r\nhttps://github.com/appcelerator/titanium_mobile/blob/50dec34783b243948ef3dfdde25750ef9ff478d8/android/titanium/src/java/org/appcelerator/titanium/proxy/IntentProxy.java#L63\r\nhttps://github.com/appcelerator/titanium_mobile/blob/50dec34783b243948ef3dfdde25750ef9ff478d8/android/titanium/src/java/org/appcelerator/titanium/proxy/IntentProxy.java#L66\r\n\r\nThe crash occurs in the native code of android. Last debug point was in MessageQueue.class line 581:-\r\n{code}\r\n // We can assume mPtr != 0 because mQuitting is false.\r\n if (needWake) {\r\n nativeWake(mPtr);\r\n }\r\n{code}\r\n\r\nWill be leaving ticket open.\r\n[~fokkezb] Fyi.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-11T06:37:36.000+0000", "updated": "2016-05-11T06:37:36.000+0000" }, { "id": "385486", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Setting this for release 6.0.0 instead due to bug.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-12T02:23:20.000+0000", "updated": "2016-05-12T02:23:20.000+0000" }, { "id": "386510", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR: https://github.com/appcelerator/titanium_mobile/pull/8013\r\nTesting code:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : 'black',\r\n layout : 'vertical'\r\n});\r\nwin.open();\r\nTi.API.info(\"Class name: \" + Titanium.Android.currentActivity.intent.getClassName());\r\nTi.API.info(\"Class name: \" + Titanium.Android.currentActivity.intent.className);\r\n\r\nTi.API.info(\"Package name: \" + Titanium.Android.currentActivity.intent.getPackageName());\r\nTi.API.info(\"Package name: \" + Titanium.Android.currentActivity.intent.packageName);\r\n\r\n\r\nvar intent = Ti.Android.createIntent({className: \"com.test.classnameActivity\", packageName: \"com.test\"});\r\n\r\nTi.API.info(\"Class name: \" + intent.getClassName());\r\nTi.API.info(\"Class name: \" + intent.className);\r\n\r\nTi.API.info(\"Package name: \" + intent.getPackageName());\r\nTi.API.info(\"Package name: \" + intent.packageName);\r\n{code}", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-23T18:33:28.000+0000", "updated": "2016-05-23T18:42:17.000+0000" }, { "id": "386733", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/8013 has been merged.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-25T04:37:11.000+0000", "updated": "2016-05-25T04:37:11.000+0000" }, { "id": "390207", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\nThe {{Ti.Android.currentActivity.intent.className}} & {{Ti.Android.currentActivity.intent.packageName}} is not {{undefined}}.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.7.0.201607070843\r\nTi SDK : 5.4.0.v20160705213725\r\nTi CLI : 5.0.9\r\nAlloy : 1.9.1\r\nMAC El Capitan : 10.11.5\r\nAppc NPM : 4.2.8-1\r\nAppc CLI : 5.4.0-29\r\nNode: 4.4.4\r\nNexus 6 - Android 6.0.1", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-07-08T23:45:57.000+0000", "updated": "2016-07-08T23:46:08.000+0000" } ], "maxResults": 18, "total": 18, "startAt": 0 } } }