What is the purpose for the the empty parentheses following onClickListener
in this snippet of Android code? (I'm wondering, since onClickListener
is an interface.)
Button btn = (Button) findViewById(R.id.mybutton);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
myFancyMethod(v);
}
});