Pattern for making a custom listener in Android.