How to create a class and have a property of type "method"?

0

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?

    
asked by anonymous 27.05.2016 / 03:10

0 answers