I am insanely curious why this is happening in Eclipse. I have a
workaround, but I really want to know what's going on.
I have an ItemizedOverlay<OverlayItem> which has this implemented
onTouchEvent method:
public boolean onTouchEvent(MotionEvent event, MapView mapView)
{
MapItem m = this.getFocus();
if(m == null)
{
return false;
}
else
{
return true;
}
}
I have breakpoints in Eclipse... If the MapItem really is null it
breaks on return false; but if I click Resume it immediately breaks on
return true; as well. I also have a breakpoint on the getFocus() call
which isn't breaking again, so I know it's not just firing the event
twice, it's actually breaking on return false; and then breaking again
in the same method call on return true;.
I have no idea how this is possible, or what it means the method is
actually returning because any code i put after the return statements
is unreachable.
If the MapItem is not null it only returns true;.
The workaround I have is this which seems to deliver expected
behaviour:
public boolean onTouchEvent(MotionEvent event, MapView mapView)
{
boolean result;
MapItem m = this.getFocus();
if(m == null)
{
result = false;
}
else
{
result = true;
}
return result;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---