The active text field sample application shows how a BlackBerry® device user can access customized items from the context menu when a pattern is recognized in an active text field. You can create active text fields by using the ActiveAutoTextEditField class and ActiveRichTextField class.
When the BlackBerry device starts, the application, pattern, and associated menu items are registered with the PatternRepository. When text with the matching pattern is found in an active text field, the text is highlighted. When the user clicks highlighted text, the context menu is displayed with the menu items that are associated with the pattern.
In the sample application, when the user types a nine-digit number into an active text field, the user can click this number and a context menu with Status and Location options appears. When the user clicks one of the options, the application displays the requested information.