[mono-android] [BUG?] OnKeyLongPress doesn't work
Amir Waldman
amirw2k at gmail.com
Mon Mar 21 04:16:00 EDT 2011
Thanks Jon, very helpful. I will look into it.
Regards,
Amir
-----Original Message-----
From: monodroid-bounces at lists.ximian.com
[mailto:monodroid-bounces at lists.ximian.com] On Behalf Of Jonathan Pryor
Sent: Monday, March 21, 2011 4:38 AM
To: monodroid at lists.ximian.com
Subject: Re: [mono-android] [BUG?] OnKeyLongPress doesn't work
On Mar 20, 2011, at 7:00 AM, Amir Waldman wrote:
> I've overridden OnKeyLongPress in the Activity but it doesn't seem to do
anything, the debugger never stops there.
As a guess:
http://developer.android.com/reference/android/view/KeyEvent.Callback.html#o
nKeyLongPress(int, android.view.KeyEvent)
implies that you need to _also_ override Activity.OnKeyDown()[0] _and_ call
KeyEvent.StartTracking()[1].
> Is it possible to catch the Back button's long press?
The Activity.OnKeyDown() docs [1] suggest that Activity.OnKeyDown() is
responsible for the Back button behavior in the first place, which does
suggest that you _can_ catch it, if you override Activity.OnKeyDown().
- Jon
[0]
http://docs.mono-android.net/index.aspx?link=M%3aAndroid.App.Activity.OnKeyD
own(Android.Views.Keycode%2cAndroid.Views.KeyEvent)
[1] http://docs.mono-android.net/index.aspx?link=T%3aAndroid.Views.KeyEvent
_______________________________________________
Monodroid mailing list
Monodroid at lists.ximian.com
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
More information about the Monodroid
mailing list