title: Registering listener in java/android, a little question
body: <p>I wan reading <a href="http://developer.android.com/guide/topics/ui/ui-events.html" rel="nofollow">here</a> about handling UI events. I know java pretty well but still never
  had the chance of writing a gui so I don't know much about listeners. Anyway, they use 
  a technique I have never came across before, here's what I mean </p>
  
  <pre><code>// Create an anonymous implementation of OnClickListener
  private OnClickListener mCorkyListener = new OnClickListener() {
    public void onClick(View v) {
      // do something when the button is clicked
    }
  };
  </code></pre>
  
  <p>The first line of code confuses me: it looks like a declareation of a new object, but then
  its a method? I just don't understand this code and if you can help me understand it I can continue my assignment :)</p>
  
  <p>P.s. two more question: if I have several buttons on the screen, they all share the same onCLick() method? and if so, how do I know which one was clicked? </p>
  
  <p>Thanks!</p>