Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using IInputFilter in MonoForAndroid

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?

like image 947
Ricky Helgesson Avatar asked Jun 10 '26 05:06

Ricky Helgesson


1 Answers

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
    }

}
like image 122
Alex Wiese Avatar answered Jun 20 '26 17:06

Alex Wiese



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!