Android Guides | Samples

Android.Telephony.PhoneNumberFormattingTextWatcher Class

Watches a TextView and if a phone number is entered will format it.

See Also: PhoneNumberFormattingTextWatcher

Syntax

[Android.Runtime.Register("android/telephony/PhoneNumberFormattingTextWatcher", DoNotGenerateAcw=true)]
public class PhoneNumberFormattingTextWatcher : Object, ITextWatcher, IDisposable

Remarks

Watches a TextView and if a phone number is entered will format it.

Stop formatting when the user

  • Inputs non-dialable characters
  • Removes the separator in the middle of string.

The formatting will be restarted once the text is cleared.

[Android Documentation]

Requirements

Namespace: Android.Telephony
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Telephony.PhoneNumberFormattingTextWatcher are listed below.

See Also: Object

Public Constructors

The formatting is based on the current system locale and future locale changes may not take effect on this instance.
The formatting is based on the given countryCode.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

AfterTextChanged(IEditable)
This method is called to notify you that, somewhere within s, the text has been changed.
BeforeTextChanged(ICharSequence, Int32, Int32, Int32)
This method is called to notify you that, within s, the count characters beginning at start are about to be replaced by new text with length after.
BeforeTextChanged(String, Int32, Int32, Int32)
OnTextChanged(ICharSequence, Int32, Int32, Int32)
This method is called to notify you that, within s, the count characters beginning at start have just replaced old text that had length before.
OnTextChanged(String, Int32, Int32, Int32)