Code example for PhoneNumberFormattingTextWatcher

0
      this.filterPreviewMatch = filterPreviewMatch;
       
      this.filterMatchListeners = new LinkedList<FilterPreviewMatchListener>();
       
      // Format anything in the preview as a phone number in the current locale. 
      filterPreview.addTextChangedListener(new PhoneNumberFormattingTextWatcher());
       
      // When the preview text changes, update. 
      filterPreview.addTextChangedListener(this);     
   } 
 
   public void clearFilterPreviewPattern() { 
      filterPreviewPattern = null;
      toggleFilterPreviewMatchVisibility(false); 
      updateListeners(false);  
   } 
    
   public void addFilterPreviewMatchListener(FilterPreviewMatchListener l) {
      filterMatchListeners.add(l);
   }