CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2014-07-06
by vinay Maneti

Original Post

Original - Posted on 2011-08-04
by MByD



            
Present in both answers; Present only in the new answer; Present only in the old answer;

[`View.OnClickListener` is an interface][1], you don't call it, but creates a new instance of it (`new View.OnClickListener()` is a call to the constructor)
The instance you create is of [anonymous class][2] that `implements` `View.OnClickListener`, in the brackets right under `new View.OnClickListener()`
Any class that implements `View.OnClickListener` must implement the methods declared in it (e.g. [onClick][3])
`setOnClickListener` just saves the reference to the View.OnClickListener instance you supplied, and when someone clicks the button, the `onClick` method of the listener you set is getting called.

[1]: http://developer.android.com/reference/android/view/View.OnClickListener.html [2]: http://docstore.mik.ua/orelly/java-ent/jnut/ch03_12.htm [3]: http://developer.android.com/reference/android/view/View.OnClickListener.html#onClick%28android.view.View%29
[`View.OnClickListener` is an interface][1], you don't call it, but creates a new instance of it (`new View.OnClickListener()` is a call to the constructor)
The instance you create is of [anonymous class][2] that `implements` `View.OnClickListener`, in the brackets right under `new View.OnClickListener()`
Any class that implements `View.OnClickListener` must implement the methods declared in it (e.g. [onClick][3])
`setOnClickListener` just saves the reference to the View.OnClickListener instance you supplied, and when someone clicks the button, the `onClick` method of the listener you set is getting called.

[1]: http://developer.android.com/reference/android/view/View.OnClickListener.html [2]: http://docstore.mik.ua/orelly/java-ent/jnut/ch03_12.htm [3]: http://developer.android.com/reference/android/view/View.OnClickListener.html#onClick%28android.view.View%29

        
Present in both answers; Present only in the new answer; Present only in the old answer;