I must use OnKeyDown listener of the EditText object to catch a key. I can't use the KeyPress event in my situation (long story). So how can I achieve this. I tried:
public class MyKeyListener : Java.Lang.Object, EditText.IOnKeyListener
{
public bool OnKeyDown(Keycode k, KeyEvent e)
{
//do something
return false;
}
}
I put this code in my apps own namespace, and then I set the listener: input.SetOnKeyListener (new MyKeyListener ());
But it just gave the error: Error CS0535: 'Android.Views.MyKeyListener' does not implement interface member 'Android.Views.View.IOnKeyListener.OnKey(Android.Views.View, Android.Views.Keycode, Android.Views.KeyEvent)'
How can I achieve this?