Most samples that I see appear to use an anonymous method in a call like button.setOnClickListener(). Instead, I'd like to pass in a method defined on the Activity class that I'm working in. What's the Java/Android equivalent of the following event handler wiring in C#?
Button myButton = new Button();
myButton.Click += this.OnMyButtonClick;
Where:
private void OnMyButtonClick(object sender, EventArgs ea)
{
}
Essentially, I'd like to reuse a non-anonymous method to handle the click event of multiple buttons.