Some time ago I had seen an Android Java code like this:
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Perform action on click
}
});
How can I subscribe to a method of an object?