I have this in onCreate:
mTrueButton = (Button) findViewById(R.id.true_button);
mTrueButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
checkAnswer(true);
}
});
This method is defined like this in Android API:
public void setOnClickListener(View.OnClickListener l) {
throw new RuntimeException("Stub!");
}
I understand that we create an anonymous class here to implement onClick() from View.OnClickListener interface.
However I am confused what does this method do exactly; it's not returning anything and not mutating anything, just throwing and exception so why do we have it here?
Thanks.