I need to implement a RegExpInputFilter as an IInputFilter in Mono for Android but I do not understand how to do it. Is there some guidance on how to implement Java interfaces somewhere that explains this in detail? Or even better, has anyone written their own IInputFilter in Mono for Android that can share the code or just some tips?

有帮助吗?

解决方案

IInputFilter is already part of the Mono for Android framework

It is part of the Android.Text namespace

http://androidapi.xamarin.com/?link=T:Android.Text.IInputFilter

class RegExInputFilter : Java.Lang.Object, IInputFilter
{
    public Java.Lang.ICharSequence FilterFormatted(Java.Lang.ICharSequence source, int start, int end, ISpanned dest, int dstart, int dend)
    {
       //filter
    }

}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top