button.setOnClickListener is giving me errors
<pre><code> Button myButton = new Button(this);
        myButton.setText("Change View");
        myButton.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
        myButton.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {

                Context context = getApplicationContext();
                CharSequence text = "Hello toast!";
                int duration = Toast.LENGTH_SHORT;

                Toast toast = Toast.makeText(context, text, duration);
                toast.show();

                }
        });
</code></pre>

<p>What exactly is wrong with this code? It gives me an error where I set the onClickListener. I also had to remove the @override above public void despite the fact that other examples have them.</p>
