Java programming technic question
I was ready some Android codes, then I saw this:
findViewById(R.id.myButton).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Do stuff
}
});
I just don't understand how you can have onClick(View v) inside
public void onClick(View v) {
// Do stuff
}
because to me findViewById(R.id.myButton).setOnClickListener(new View.OnClickListener() {
}); is a method, how can one have one method inside an other ?
I am aware that one can call a method inside another, this is not the case, or I am wrong.
So i am confused by this.