{ "id": "85375", "key": "AC-2848", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-12-19T06:01:41.000+0000", "created": "2012-01-24T11:44:19.000+0000", "labels": [ "android", "defect" ], "versions": [], "issuelinks": [], "assignee": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:47:47.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "We are in a window, where upon saving the information we have to redirect the user to another window. So on the successful save, we are doing an activity.finish() and opening up the new window. \r\n\r\nTitanium.Android.currentActivity.finish(); \r\npm.view.newWindow().open(); \r\n\r\n[OR]\r\n\r\npm.view.newWindow().open();\r\nTitanium.Android.currentActivity.finish(); \r\n\r\nOn the new window, when i click or do any event handling stuffs... i get the following trace, with no activity happening. \r\n\r\nTRACE] W/InputManagerService( 67): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@41106250", "attachment": [], "flagged": false, "summary": "Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40931b58", "creator": { "name": "vinothbabu", "key": "vinothbabu", "displayName": "Vinothbabu", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "vinothbabu", "key": "vinothbabu", "displayName": "Vinothbabu", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK 3.0 \r\nTitanium SDK 3.1.3 ", "comment": { "comments": [ { "id": "190380", "author": { "name": "dgandhi", "key": "dgandhi", "displayName": "Devang Gandhi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Vinoth, \r\nIn order to address this issue, we need more details. Can you please send us some sample test case, steps to reproduce and the Titanium version you use? Once we get your reply, we will be able to consider this issue.\r\nThanks,", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-04-09T15:45:01.000+0000", "updated": "2012-04-10T22:23:36.000+0000" }, { "id": "273474", "author": { "name": "sumanvarma83", "key": "sumanvarma83", "displayName": "Suman Varma", "active": true, "timeZone": "America/Los_Angeles" }, "body": "what is resolution for this .... have you resolved or just taggged", "updateAuthor": { "name": "sumanvarma83", "key": "sumanvarma83", "displayName": "Suman Varma", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-01T06:15:52.000+0000", "updated": "2013-10-01T06:17:07.000+0000" }, { "id": "280489", "author": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Suman,\n\nWe need a test case to move this forward. If you are experiencing the same issue, please post your test case and we will have it reviewed again.\n\nThanks,", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-11-21T02:56:30.000+0000", "updated": "2013-11-21T02:56:30.000+0000" }, { "id": "283922", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "h5. Testing Environment: \r\nTi CLI 3.2.0\r\nTitanium SDK: 3.1.3\r\nAndroid SDK: 4.2.2\r\nAndroid Device \r\n\r\nh5. Test Code\r\n\r\napp.js\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tnavBarHidden : false,\r\n\ttitle : 'First Window',\r\n\tbackgroundColor : '#000',\r\n\tlayout : 'vertical',\r\n\texitOnClose : true\r\n\r\n});\r\n\r\n// Create a Button.\r\nvar btn = Ti.UI.createButton({\r\n\ttitle : 'Test Button',\r\n\theight : Ti.UI.SIZE,\r\n\twidth : Ti.UI.SIZE,\r\n\ttop : 10,\r\n});\r\n\r\nvar win2 = Ti.UI.createWindow({\r\n\tnavBarHidden : false,\r\n\ttitle : 'Second Window',\r\n\tbackgroundColor : 'red',\r\n\r\n});\r\n\r\n// Listen for click events.\r\nbtn.addEventListener('click', function() {\r\n // You would run into the reported error if you change the order here i.e. finish the current activity before opening another window\r\n\twin2.open();\r\n\tTitanium.Android.currentActivity.finish();\r\n});\r\n\r\n// Add to the parent view.\r\nwin.add(btn);\r\n\r\nwin.open();\r\n\r\n{code}\r\n \r\n\r\nh5. Steps to Test\r\n\r\n1. Create a new project\r\n2. Update app.js \r\n4. And run android device \r\n5. Click on “Test Button”\r\n6. Second window opens correctly\r\n", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-12T04:11:03.000+0000", "updated": "2013-12-19T06:01:31.000+0000" }, { "id": "285141", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Android.Activity-method-finish\n\nExcerpt from the documentation:\nIn almost all cases, an activity is associated with a window. Activities are central to the Android Back button navigation - the Back button closes the current activity and returns to whatever activity was open previously.\n\nAn activity is not created until the window is opened. When a window is created, its activity property refers to an empty JavaScript object. After the window is opened, a real Activity object is created and the properties from the JavaScript object are copied over. The activity property now refers to this real Activity object, which you can use to call the various Activity methods. \n\nTitanium.Android.currentActivity.finish() closes the current activity and goes back to the previous activity. If you have a single activity then there is no activity to go back to and you run into the error you described. You should design your application in a way so that you have an activity to fall back to. Please refer to the example code above that works fine since we are closing the second window activity in this case.\n", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-19T05:58:20.000+0000", "updated": "2013-12-19T05:58:20.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }