Hi,
I have a CustMapView class which extends MapView and have added some
custom overlays to it (derived from Overlay). I'm handling
KEYCODE_DPAD_CENTER events so that if the marker of one Overlay is in
the center of the map a menu is displayed; now, I'd like the event to
be re-dispatched to my CustMapView if no Overlay ca handle it, but the
problem is that this doesn't work. This is my CustMapView.onKeyDown
routine:
public boolean onKeyDown(int keyCode, android.view.KeyEvent e)
{
if ( keyCode == KeyEvent.KEYCODE_DPAD_UP || keyCode ==
KeyEvent.KEYCODE_DPAD_DOWN || keyCode == KeyEvent.KEYCODE_DPAD_LEFT
|| keyCode == KeyEvent.KEYCODE_DPAD_RIGHT )
{
// I want my MapView to pan!
super.onKeyDown(keyCode, e);
return true;
}
// the super call always return true, even if none of my Overlays
has handled the event in their
// onKeyDown method
if ( super.onKeyDown(keyCode, e) )
{
System.out.println ("Someone else handled it!");
return true;
}
return false;
}
Any hints on how I can solve this?
Thank you,
claudio
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---