{ "id": "86307", "key": "TIMOB-7610", "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": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2012-07-31T16:25:51.000+0000", "created": "2012-02-09T22:13:32.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "15783", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "85267", "key": "TIMOB-7326", "fields": { "summary": "Android: rightView / leftView crash app", "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 } } } }, { "id": "15134", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "79390", "key": "TIMOB-5038", "fields": { "summary": "Android: API Parity: clickEvent are not handled in map annotations", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-10T19:17:23.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": "A fatal exception occurs when selecting an annotation that has an instance of Ti.UI.View passed as the rightView parameter.\r\n\r\n- This error doesn't occur if you pass an instance of ImageView as rightView and leave leftView unset. The image view is displayed as expected.\r\n- It does occur if you specify the Ti.UI.View instance as either leftView or rightView, and set the ImageView as the other view.\r\n- It doesn't occur if you set a Ti.UI.View instance to leftView and leave rightView unset. Although in this case, the view still isn't displayed.\r\n\r\nTest case:\r\n\r\n{code}\r\n\r\nvar win = Titanium.UI.createWindow({\r\n\tmodal : true,\r\n\tbackgroundColor : 'white'\r\n});\r\n\r\n// an image view...\r\nvar pane = Ti.UI.createImageView({\r\n\timage : 'pin2.png',\r\n\twidth : 30,\r\n\theight : 30\r\n})\r\n\r\n// and a plain view\r\nvar plain = Titanium.UI.createView({\r\n\twidth : 20,\r\n\theight : 20,\r\n\tbackgroundColor : '#336699'\r\n});\r\n\r\nvar atlantaParams = {\r\n\tlatitude : 33.74511,\r\n\tlongitude : -84.38993,\r\n\ttitle : \"Atlanta, GA\",\r\n\tsubtitle : 'Atlanta Braves Stadium\\nfoo',\r\n\tpincolor : Titanium.Map.ANNOTATION_GREEN,\r\n\tanimate : true,\r\n\t//\tleftView : pane,\r\n\trightView : plain\r\n};\r\n\r\nvar atlanta = Titanium.Map.createAnnotation(atlantaParams);\r\n\r\n// CREATE MAP VIEW\r\n//\r\nvar mapview = Titanium.Map.createView({\r\n\tmapType : Titanium.Map.STANDARD_TYPE,\r\n\tregion : {\r\n\t\tlatitude : 33.74511,\r\n\t\tlongitude : -84.38993,\r\n\t\tlatitudeDelta : 0.5,\r\n\t\tlongitudeDelta : 0.5\r\n\t},\r\n\tanimate : true,\r\n\tregionFit : true,\r\n\tuserLocation : true,\r\n\tannotations : [atlanta]\r\n});\r\n\r\nmapview.selectAnnotation(atlanta);\r\nwin.add(mapview);\r\nwin.open();\r\n{code}\r\n\r\nStack trace:\r\n{code}\r\n\r\nE/AndroidRuntime( 1387): FATAL EXCEPTION: main\r\nE/AndroidRuntime( 1387): java.lang.NullPointerException\r\nE/AndroidRuntime( 1387): \tat ti.modules.titanium.map.TiOverlayItemView.setItem(TiOverlayItemView.java:191)\r\nE/AndroidRuntime( 1387): \tat ti.modules.titanium.map.TiMapView.showAnnotation(TiMapView.java:493)\r\nE/AndroidRuntime( 1387): \tat ti.modules.titanium.map.TiMapView.doSelectAnnotation(TiMapView.java:727)\r\nE/AndroidRuntime( 1387): \tat ti.modules.titanium.map.TiMapView.handleMessage(TiMapView.java:471)\r\nE/AndroidRuntime( 1387): \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\nE/AndroidRuntime( 1387): \tat android.os.Looper.loop(Looper.java:123)\r\nE/AndroidRuntime( 1387): \tat android.app.ActivityThread.main(ActivityThread.java:4627)\r\nE/AndroidRuntime( 1387): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\nE/AndroidRuntime( 1387): \tat java.lang.reflect.Method.invoke(Method.java:521)\r\nE/AndroidRuntime( 1387): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)\r\nE/AndroidRuntime( 1387): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)\r\nE/AndroidRuntime( 1387): \tat dalvik.system.NativeStart.main(Native Method)\r\n{code}\r\n\r\nGiven the peculiar left/right behavior, I noted that the line we crash on,\r\nTiOverlayItemView.java:191:\r\n\r\n\r\n191 rightPane.addView(rightView.peekView().getNativeView());\r\n\r\nDoes not match the corresponding code for leftView:\r\n\r\n167 leftPane.addView((leftView.getOrCreateView()).getNativeView());\r\n\r\nAlthough otherwise the handling of these views appears to be identical.\r\n\r\nAlso, I wonder if this behavior explains some of the peculiarities reported in TIMOB-5038,\r\nwhere the annotation is not being updated.", "attachment": [], "flagged": false, "summary": "Android: MapView crashes when annotation has ordinary view as rightView property", "creator": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "186146", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I tested the fix I suggested above. It appears that replacing peekView() with getOrCreateView() does indeed prevent the crash. However, it's only a partial fix, because an instance of Ti.UI.View still isn't displayed, while an instance of Ti.UI.ImageView *is* displayed.\r\n\r\nIt is beyond my abilities to divine why this might be.\r\n\r\nHowever, when I tried a label as the rightView, I noted that the label shows up, but its width and height values are not honored--instead, it's sized to fit the text content. The image view, however, scales to the specified size. Maybe this is something to do with how the sizes are enforced on the underlying native views?\r\n", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-12T22:40:33.000+0000", "updated": "2012-03-12T23:06:41.000+0000" }, { "id": "210888", "author": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is a duplicate of [TIMOB-7610], which is resolved as \"Fixed\". I verified that the code shown here works with that fix.", "updateAuthor": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-31T16:25:51.000+0000", "updated": "2012-07-31T16:25:51.000+0000" }, { "id": "411313", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-10T19:17:23.000+0000", "updated": "2017-03-10T19:17:23.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }