{ "id": "89780", "key": "TIMOB-8669", "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": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" } ], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2013-04-02T11:24:17.000+0000", "created": "2012-04-10T13:06:35.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api", "parity" ], "versions": [], "issuelinks": [], "assignee": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-21T22:04: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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2. Problem\r\n\r\nOn Android, the error event is only triggered once if an image is not accessible. On iOS, it triggers the error event each time. Which is better in my opinion.\r\n\r\nh2. Test case\r\n{code:title=app.js|borderStyle=solid}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\nwin.open();\r\n \r\nfunction createImageView (params) {\r\n var imageView = Ti.UI.createImageView(params);\r\n \r\n imageView.addEventListener('load', function (event) {\r\n Ti.API.info('load event');\r\n });\r\n \r\n imageView.addEventListener('error', function (event) {\r\n Ti.API.info('error event');\r\n });\r\n \r\n return imageView;\r\n}\r\n \r\nTi.API.info('loading first image');\r\nwin.add(createImageView({image: 'https://invalid.url/doesnotexist.png', width: 200, height: 100, top: 50}));\r\n \r\nsetTimeout(function () {\r\n Ti.API.info('loading second image');\r\n \r\n win.add(createImageView({image: 'https://invalid.url/doesnotexist.png', width: 200, height: 100, top: 150}));\r\n}, 2000);\r\n{code} \r\n\r\nWhen executing this code, you'll notice that the {{error event}} is just displayed once in error log. The {{load event}} is never triggered. On iOS the {{error event}} is triggered twice.\r\nThis is especially inappropriate if the image is not available for just a short time. On the next app start the {{error event}} is also not triggered since it is cached. It should try to reload the image.\r\n\r\nh2. Community Discussion \r\nQ&A [Android Parity: ImageView triggers error event only once|http://developer.appcelerator.com/question/135037/android-parity-imageview-triggers-error-event-only-once]\r\n\r\nI've also explained why I need the error event.\r\n\r\nh2. Log\r\n{code}\r\nD/TiAssetHelper( 410): Fetching \"app.js\" with Fastdev...\r\nI/TiAPI ( 410): loading first image\r\nD/dalvikvm( 410): GC_EXTERNAL_ALLOC freed 537K, 53% free 2895K/6087K, external 1967K/2137K, paused 159ms\r\nI/TiRootActivity( 410): (main) [0,0] checkpoint, on root activity resume. activity = de.test.mobile.TestMobileActivity@405a4498\r\nD/dalvikvm( 410): GREF has increased to 201\r\nE/TiDownloadManager( 410): (pool-3-thread-1) [31,31] Exception downloading https://invalid.url/doesnotexist1.png\r\nE/TiDownloadManager( 410): java.net.ConnectException: invalid.url/62.157.140.133:443 - Connection refused\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:207)\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:437)\r\nE/TiDownloadManager( 410): \tat java.net.Socket.connect(Socket.java:983)\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.(HttpConnection.java:74)\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.(HttpConnection.java:48)\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:298)\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:381)\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeConnection(HttpsURLConnectionImpl.java:369)\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1018)\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:510)\r\nE/TiDownloadManager( 410): \tat org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:247)\r\nE/TiDownloadManager( 410): \tat java.net.URL.openStream(URL.java:645)\r\nE/TiDownloadManager( 410): \tat org.appcelerator.titanium.util.TiDownloadManager$DownloadJob.run(TiDownloadManager.java:157)\r\nE/TiDownloadManager( 410): \tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)\r\nE/TiDownloadManager( 410): \tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)\r\nE/TiDownloadManager( 410): \tat java.lang.Thread.run(Thread.java:1019)\r\nI/TiAPI ( 410): error event\r\nI/TiAPI ( 410): loading second image\r\nD/dalvikvm( 136): GC_EXPLICIT freed 50K, 51% free 2971K/5959K, external 4969K/5664K, paused 51ms\r\nI/InputReader( 62): Device reconfigured: id=0x0, name=qwerty2, display size is now 480x854\r\nI/InputManager-Callbacks( 62): No virtual keys found for device qwerty2.\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: ImageView triggers error event only once", "creator": { "name": "mkrug", "key": "mkrug", "displayName": "Markus Krug", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mkrug", "key": "mkrug", "displayName": "Markus Krug", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* Titanium SDK version: 1.8.2, 2.0.0.v20120328101644\r\n* Javascript Engine: V8 \r\n* Platform & version: Android OS, tested with Android 2.3\r\n* Device Details: Android emulator, Samsung Galaxy S2\r\n* Host Operating System: OSX 10.7.3\r\n* Titanium Studio version: 1.0.9", "comment": { "comments": [ { "id": "245162", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue does not reproduces \r\n\r\n\r\nTested with\r\n\r\nTitanium Studio, build: 3.2.0.201212181159\r\nTitanium SDK version: 3.1.0 \r\nTitanium SDK version: 3.0.2 \r\niOS iPhone Simulator: iOS SDK version: 6.0\r\n", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-02T11:24:17.000+0000", "updated": "2014-01-24T09:51:18.000+0000" }, { "id": "414528", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced and due to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T22:04:47.000+0000", "updated": "2017-03-21T22:04:47.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }