IInputFilter.FilterFormatted Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This method is called when the buffer is going to replace the
range dstart … dend
of dest
with the new text from the range start … end
of source
.
[Android.Runtime.Register("filter", "(Ljava/lang/CharSequence;IILandroid/text/Spanned;II)Ljava/lang/CharSequence;", "GetFilter_Ljava_lang_CharSequence_IILandroid_text_Spanned_IIHandler:Android.Text.IInputFilterInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Lang.ICharSequence? FilterFormatted (Java.Lang.ICharSequence? source, int start, int end, Android.Text.ISpanned? dest, int dstart, int dend);
[<Android.Runtime.Register("filter", "(Ljava/lang/CharSequence;IILandroid/text/Spanned;II)Ljava/lang/CharSequence;", "GetFilter_Ljava_lang_CharSequence_IILandroid_text_Spanned_IIHandler:Android.Text.IInputFilterInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member FilterFormatted : Java.Lang.ICharSequence * int * int * Android.Text.ISpanned * int * int -> Java.Lang.ICharSequence
Parameters
- source
- ICharSequence
- start
- Int32
- end
- Int32
- dest
- ISpanned
- dstart
- Int32
- dend
- Int32
Returns
- Attributes
Remarks
This method is called when the buffer is going to replace the range dstart … dend
of dest
with the new text from the range start … end
of source
. Return the CharSequence that you would like to have placed there instead, including an empty string if appropriate, or null
to accept the original replacement. Be careful to not to reject 0-length replacements, as this is what happens when you delete text. Also beware that you should not attempt to make any changes to dest
from this method; you may only examine it for context.
Note: If <var>source</var> is an instance of Spanned
or Spannable
, the span objects in the <var>source</var> should be copied into the filtered result (i.e. the non-null return value). TextUtils#copySpansFrom
can be used for convenience if the span boundary indices would be remaining identical relative to the source.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.