[AC-2300] Android: Problem with Annotation rightView
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2013-07-23T22:00:00.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android, annotations, view |
Reporter | Armindo Da Silva |
Assignee | Mauro Parra-Miranda |
Created | 2013-06-14T08:21:41.000+0000 |
Updated | 2016-03-08T07:41:18.000+0000 |
Description
*Problem*
When using rightView property annotation, when clearing all annotations, it seems that on Android, it deletes the view as well, so next time you update the annotation (by recreating them), when you click on annotations it crashes the app.
*Test case*
var annotView = Titanium.UI.createView({
height : '32dp',
width : '70dp'
});
function createAnnotations() {
// then a loop for creating annotations
for (var i = 0; i < annot.length; i++) {
// some stuff here
var annotation = Titanium.Map.createAnnotation({
latitude : lat,
longitude : lon,
title : myTitle,
subtitle : myTitle,
animate : true,
leftButton : '/images/myImg.png',
dataId : i,
rightView : annotView
});
// some stuff here
};
};
// call createAnnotations();
Now you can click the annotations and it works fine.
Then you clear all annotations and call createAnnotations() again.
If you click on an annotation it crashes the app.
This code works fine on iOS.
Hi Armindo, It would help a lot if you could edit your test case to be runnable in a project so that we can easily reproduce the crash. Thanks!