title: What to do if i get cannot find symbol class onclicklistener error?
body: <p>I am writing another program but this time on Android Studio as an app in Java. Now I am getting following error; error: cannot find symbol class OnClickListener</p>
  
  <p>How do I fix this? Here is my code:</p>
  
  <pre><code>package tegabyte.testprogramm;
  
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.TextView;
  
  public class MainActivity extends AppCompatActivity {
  
      EditText firstNumber;
      EditText secondNumber;
      TextView addResult;
      Button btnAdd;
  
      double num1,num2,sum;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          firstNumber = (EditText)findViewById(R.id.txtBase);
          secondNumber = (EditText)findViewById(R.id.txtNikotin);
          addResult = (TextView)findViewById(R.id.txtResult);
          btnAdd = (Button)findViewById(R.id.btnAdd);
  
          btnAdd.setOnClickListener(new OnClickListener() {
  
              public void onClick(View v) {
                  num1 = Double.parseDouble(firstNumber.getText().toString());
                  num2 = Double.parseDouble(secondNumber.getText().toString());
                  sum = num1 / 20 * num2;
                  addResult.setText(Double.toString(sum));
              }
          });
      }
  }
  </code></pre>
  
  <p>Any help is appreciated. Thank you!</p>