> I have written a subclass of EditText that has an > onFocusChangeListener that brings up a keyboard on focus. I have view > that uses this EditText that needs to register an > onFocusChangeListener on the same EditText. Setting the listener in > the view kills the listener that brings up the keyboard. > > I could extend the listener that calls up the keyboard, call super and > then do my custom listener actions. But this seems like a very non- > object oriented way of doing things. > > What are my options other than what I mentioned above?
You could create a CompositeListener class that forwards events to each member of a list of Listeners, and add both the original and your "real" one to that list. The CompositeListener would then be reusable, as it knows nothing about your particular application logic, just the act of forwarding. I think there is GoF Composite pattern: http://en.wikipedia.org/wiki/Composite_pattern -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.2 Published! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---