{ "id": "171988", "key": "AC-5819", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2018-08-01T13:47:51.000+0000", "created": "2018-07-31T22:05:58.000+0000", "labels": [ "android", "titanium" ], "versions": [], "issuelinks": [ { "id": "56703", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "171991", "key": "AC-5820", "fields": { "summary": "ti.nfc TagViewer example not working on Android", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-02T19:27:29.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Whenever I add `android:launchMode=\"singleTask\"` to the main activity of the application in tiapp.xml, and build the application, it does not appear in the compiled `AndroidManifest.xml`.\r\n\r\nTo reproduce the issue:\r\n# Create a new project\r\n# Build to generate initial AndroidManifest.xml file: `appc ti run -b -p android`\r\n# Open the generated `build/android/AndroidManifest.xml` and copy the first `` tree to the `tiapp.xml` under `ti:app/android/manifest/application`. You will need to create the empty `` and `` elements yourself.\r\n# Add android:launchMode=\"singleTask\" to the element and save tiapp.xml.\r\n# Re-build the app using: `appc ti run -b -p android`\r\n# Open the generated `build/android/AndroidManifest.xml`, and you will see the `android:launchMode=\"singleTask\"` was not added.\r\n\r\nHere is an example of how the tiapp.xml file will look something like:\r\n\r\n\r\n{code:xml}\r\n\r\n\r\n Sandbox\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n{code}\r\n\r\n\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "Cannot change launchMode for Android in tiapp.xml", "creator": { "name": "yahya12", "key": "yahya12", "displayName": "Yahya Uddin", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "yahya12", "key": "yahya12", "displayName": "Yahya Uddin", "active": true, "timeZone": "Europe/London" }, "environment": "Operating System\r\n Name = Microsoft Windows 10 Home\r\n Version = 10.0.17134\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 15.9GB\r\n\r\nNode.js\r\n Node.js Version = 8.9.3\r\n npm Version = 5.5.1\r\n\r\nAppcelerator CLI\r\n Installer = 4.2.13\r\n Core Package = 7.0.4\r\n\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\n node-appc Version = 0.2.44", "comment": { "comments": [ { "id": "439634", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is not a bug. Titanium purposely ignores the \"launchMode\" setting. Attempting to set it will output the following build warning...\r\n{code}\r\n[WARN] : android:launchMode should not be used. Ignoring definition from \r\n{code}\r\n\r\nThe reason is because there is a lot of confusion about how Google's \"singleTask\" feature works. When using \"singleTask\", the Android OS will automatically close all child windows and display the root window when resuming your app. This is the OS' behavior and not Titanium's behavior. In a Titanium app, the root singleTask window is the splash-screen window. So, all Titanium windows you've opened in JavaScript will have been closed. (Again, we have no control over this behavior.)\r\n\r\nWe do offer an alternative solution via our \"tiapp.xml\" {{intent-filter-new-task}} property. Please see the following...\r\nhttps://github.com/appcelerator/titanium_mobile/pull/8897\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-01T01:13:43.000+0000", "updated": "2018-08-01T01:13:43.000+0000" }, { "id": "439639", "author": { "name": "yahya12", "key": "yahya12", "displayName": "Yahya Uddin", "active": true, "timeZone": "Europe/London" }, "body": "I see. Thank you for your help, but I would consider updating the documentation in Ti.nfc examples:\r\nhttps://github.com/appcelerator-modules/ti.nfc/blob/master/android/example/TagViewer/app/controllers/index.js", "updateAuthor": { "name": "yahya12", "key": "yahya12", "displayName": "Yahya Uddin", "active": true, "timeZone": "Europe/London" }, "created": "2018-08-01T06:46:23.000+0000", "updated": "2018-08-01T06:46:23.000+0000" }, { "id": "439640", "author": { "name": "yahya12", "key": "yahya12", "displayName": "Yahya Uddin", "active": true, "timeZone": "Europe/London" }, "body": "Please note that I have added \r\n\r\n{code:xml}\r\nfalse\r\n{code}\r\n\r\nas a child element to {{ti:app}}, but when I scan an NFC tag using the example shown above, it opens a new instance of the app with the app name as \"NFC Service\".\r\nWhat am I doing wrong?", "updateAuthor": { "name": "yahya12", "key": "yahya12", "displayName": "Yahya Uddin", "active": true, "timeZone": "Europe/London" }, "created": "2018-08-01T07:00:53.000+0000", "updated": "2018-08-01T07:00:53.000+0000" }, { "id": "439647", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~yahya12] this documentation should be more up to date, can you follow this: https://docs.appcelerator.com/platform/latest/#!/api/Modules.Nfc", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-08-01T13:46:58.000+0000", "updated": "2018-08-01T13:46:58.000+0000" }, { "id": "439648", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "Also marked this as duplicate as AC-5820 seems to be the same issue.", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-08-01T13:48:13.000+0000", "updated": "2018-08-01T13:48:13.000+0000" }, { "id": "439659", "author": { "name": "yahya12", "key": "yahya12", "displayName": "Yahya Uddin", "active": true, "timeZone": "Europe/London" }, "body": "Yes I have looked at the doc also, and it doesn't solve the issue.", "updateAuthor": { "name": "yahya12", "key": "yahya12", "displayName": "Yahya Uddin", "active": true, "timeZone": "Europe/London" }, "created": "2018-08-01T18:36:09.000+0000", "updated": "2018-08-01T18:36:09.000+0000" }, { "id": "439707", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Due to popular demand, we plan on making \"launchMode\" settable in Titanium 7.3.0 GA.\r\nPlease see: [TIMOB-26250]\r\n\r\nI've also posted code on how to deal with \"singleTask\" mode here...\r\nhttps://github.com/appcelerator/titanium_mobile/pull/10225\r\n\r\nThe key thing here is that \"singleTask\" mode will automatically close all child windows when resumed. What you're supposed to do is listen for the \"newIntent\" event from the root singleTask activity, which you can acquire on app startup. When a new intent has been received, you should display UI related to that intent.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-02T19:27:29.000+0000", "updated": "2018-08-02T19:27:29.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }