The semicolon (;) at the end of the code is the thing which is got me lost.
private View.OnClickListener onSave = new View.OnClickListener() {
public void onClick(View v) {
EditText name=(EditText)findViewById(R.id.name);
EditText address=(EditText)findViewById(R.id.addr);
r.setName(name.getText().toString());
r.setAddress(address.getText().toString());
}
};
What you have there is an instantiation of an instance of an anonymous inner class. The semicolon ends the assignment statement that assigns the new instance to
onSave. It’s basically shorthand for this: