I'm wondering if it's possible to add functionality to EditText such that when I include my newly extended field in the layout xml, I don't have to then add any code to the Activity class to get it to behave in specific ways.
For example, I'd like to make a EditPhone field which is just an EditText that has the added feature of listening for key events and modifying the field to include parenthesis and dashes in their appropriate locations.
At the moment, I'm always having to include the listener code and attach it to the view, manually. But obviously the class has a ton of default behavior that is wrapped up in it (for example, it brings up the keyboard when you click it). So, I'm guessing it shouldn't be all that tough, but I'm not clear on what the steps would be to accomplish this.
And to be clear, I don't need help with the Phone specific feature described above (I have that all worked out), I'm trying to understand how to extend View in a way that it takes on additional functionality by default, so as not to have to clutter my Activities with the same code over and over.