{ "id": "149875", "key": "TIMOB-19257", "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": [], "resolution": null, "resolutiondate": null, "created": "2015-07-24T00:33:54.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "16919", "description": "Critical updates", "name": "Release 4.1.1", "archived": true, "released": true, "releaseDate": "2015-07-15" } ], "issuelinks": [ { "id": "48521", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "150041", "key": "TIMOB-19325", "fields": { "summary": "Android: activity indicator causing crash if exiting app right after launch", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2019-11-08T03:54:55.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Create a default Alloy project with the following:\r\n\r\nindex.xml:\r\n{code}\r\n\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nindex.js\r\n{code}\r\n$.index.open();\r\n$.actInd1.show();\r\n$.actInd1.hide();\r\n{code}\r\n\r\nAt launch, sometimes the indicator still shows. Not every time you'll see this issue, so you have to keep exiting and relaunching the app to see it happen.\r\n\r\nMy app loads external url at launch. It shows an indicator when loading, and hides it when finished or failed. In cases like network failure, the indicator.hide() is called almost right away, but not actually hided every time.", "attachment": [], "flagged": false, "summary": "Android: hide() doesn't work every time on Activity Indicator at launch", "creator": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK 4.1.0/Android 5.0", "comment": { "comments": [ { "id": "452537", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hey guys - just had this bug happen to me on a app\r\n\r\nI am creating and showing an activityIndicator, then doing some network checking for a url, when the url is found the activityIndicator is hidden via activityIndicator.hide() , this works. But when the url is not found because of network error (airplane mode, no internet) the activityIndicator is hidden via activityIndicator.hide() - but the activityIndicator is still visible on the screen - when checking the activityIndicator.visible property that shows false???!! \r\n\r\nSo there must be a bug somewhere - how do I go about having this 4 year old bug looked into?\r\n\r\nAlso when adding a setTimeout for the activityIndicator.hide() it hides just fine", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-08T02:43:45.000+0000", "updated": "2019-11-08T02:43:45.000+0000" }, { "id": "452538", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Titanium Version: Titanium 7.4.2\r\nAndroid Device: Xiaomi Mi A1\r\nAndroid Version: Android Version 9\r\n\r\nI just built and ran the test above and it does if fact still fail to hide the ActivityIndicator. Adding the hide inside a setTimeout does allow it to hide.\r\n\r\nindex.js\r\n{code:java}\r\n$.index.open();\r\n$.actInd1.show();\r\nsetTimeout(function(){ \r\n\t$.actInd1.hide();\r\n}, 500);\r\n{code}\r\n\r\nAnother use case that caused me to find this bug is using Titanium.Network.Online to check if phone has internet before doing url checks / calls.\r\n\r\n{code:java}\r\n$.index.open();\r\n$.actInd1.show();\r\n\r\nif(Titanium.Network.online){\r\n\tvar url = \"http://www.appcelerator.com\";\r\n\tvar client = Ti.Network.createHTTPClient({\r\n\t\t// function called when the response data is available\r\n\t\tonload : function(e) {\r\n\t\t\tTi.API.info(\"Received text: \" + this.responseText);\r\n\t $.actInd1.hide();\r\n\t\t},\r\n\t\t// function called when an error occurs, including a timeout\r\n\t\tonerror : function(e) {\r\n\t\t\tTi.API.debug(e.error);\r\n\t\t\t$.actInd1.hide();\r\n\t\t},\r\n\t});\r\n\t// Prepare the connection.\r\n\tclient.open(\"GET\", url);\r\n\t// Send the request.\r\n\tclient.send();\r\n\r\n}else{\r\n\t$.actInd1.hide();\r\n\tTi.API.info(\"ActivityIndicator Visible: \" + $.actInd1.visible);\r\n};\r\n{code}\r\n\r\n1. Run code on phone with internet - ActivityIndicator will hide.\r\n2. Place phone in airplane more - run - ActivityIndicator will not hide\r\nindex.js \r\n3. Notice the log states visible = false - but on phone screen its still visible\r\n{code:java}\r\n[INFO] ActivityIndicator Visible: false\r\n{code}\r\n \r\n", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-08T03:52:13.000+0000", "updated": "2019-11-08T03:54:55.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }