title: Error in Adding onClickListeners to the buttons
body: <p>I am writing a simple android program for app, in that there is 2 button , i am just trying click the button &amp; display some msg by clicking ,
  here is my code for two buttons .</p>
  
  <pre><code>    protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Button buttonStart = (Button)findViewById(R.id.buttonStart);        
      buttonStart.setOnClickListener(startListener); // Register the onClick listener with             the implementation above
  
      Button buttonStop = (Button)findViewById(R.id.buttonStop);        
      buttonStop.setOnClickListener(stopListener); // Register the onClick listener with the implementation above
       }
  
  
     //Create an anonymous implementation of OnClickListener
      private OnClickListener startListener = new OnClickListener() {
       public void onClick(View v) {
        Log.d(logtag,"onClick() called - start button");              
        Toast.makeText(MainActivity.this, "The Start button was clicked.",          Toast.LENGTH_LONG).show();
        Log.d(logtag,"onClick() ended - start button");
      }
     };
  
      // Create an anonymous implementation of OnClickListener
      private OnClickListener stopListener = new OnClickListener() {
      public void onClick(View v) {
       Log.d(logtag,"onClick() called - stop button"); 
       Toast.makeText(MainActivity.this, "The Stop button was clicked.", Toast.LENGTH_LONG).show();
        Log.d(logtag,"onClick() ended - stop button");
      } 
      };
  </code></pre>
  
  <p>my error is saying that "OnClickListener cannot be resolved to a type"</p>
  
  <p>can anyone help me in this . .</p>