title: Declaring that a class implements OnClickListener vs. declaring it yourself?
body: <p>Apologies for my title, I am having trouble properly articulating the problem.</p>
  
  <p>I have seen <code>OnCLickListener</code> implemented in two ways.  The first is done by signifying that your class implements <code>OnCLickListener</code>.  The second accomplishes the task by having you declare it yourself.</p>
  
  <p>Why in the first option can you simply put <code>this</code> as your <code>setOnCLickListener</code> argument, but in the second you must go through the trouble of creating the <code>OnClickListener</code> object yourself?</p>
  
  <p>The first:</p>
  
  <pre><code>public class WidgetConfig extends Activity implements OnClickListener {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.widgetconfig);
      Button b = (Button)findViewById(R.id.bwidgetconfig);
      b.setOnClickListener(this);
      }
      //onClick defined outside of the onCreate
      @Override
      public void onClick(View arg0) {
      // TODO Auto-generated method stub
  
      }
  </code></pre>
  
  <p>The Second:</p>
  
  <pre><code>public class WidgetConfig extends Activity{
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.widgetconfig);
      Button b = (Button)findViewById(R.id.bwidgetconfig);
      b.setOnClickListener(bListener);
  }
  
  
  
  private Button bListener = new OnClickListener(){
  
  b.setOnClickListener(new OnClickListener(){
  
              @Override
              public void onClick(View v) {
  
              //TO-DO 
  
              }
  });
  </code></pre>