title: Toast inside a Button OnclickListener is not working
body: <p><code>intdelay</code> was initialized at the beginning of the code by <code>1000</code>.
  and I am trying to make sure that <code>intdelay</code>'s value is updated by the value in the edit box by adding a toast when the button is clicked.
  but when I run the app, I get the following problem:</p>
  
  <pre><code> Error:(46, 22) error: no suitable method found for makeText(&lt;anonymous OnClickListener&gt;,String,int)
  method Toast.makeText(Context,CharSequence,int) is not applicable
  (argument mismatch; &lt;anonymous OnClickListener&gt; cannot be converted to Context)
  method Toast.makeText(Context,int,int) is not applicable
  (argument mismatch; &lt;anonymous OnClickListener&gt; cannot be converted to Context)
  </code></pre>
  
  <p>This is the part of my code:</p>
  
  <pre><code>  @Override
          protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          delayedttxt=(EditText)findViewById(R.id.delayedttxt);
  
      String delay=delayedttxt.getText().toString();       //this will get a string
      try{
          int intdelay = Integer.parseInt(delay);
     }catch(NumberFormatException ex){ // handle your exception
      }
  
      Button btn=(Button)findViewById(R.id.btn);
      btn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              flashLight.switchFlash();
              Toast.makeText(this,"your integer is " + intdelay , Toast.LENGTH_LONG).show();
          }
  
      });
  </code></pre>
  
  <p>How can I solve that?</p>