Within OnClickListener it gives - "The constructor ImageView(new View.OnClickListener(){}) is undefined"?
<p>Say I have this code, which creates an ImageView and puts it into a linearlayout.</p>

<p>Also I have an OnClick listener that's supposed to, upon click, remove the old imageview and replace it with a new one.</p>

<p>But strangely it shows "The constructor ImageView(new View.OnClickListener(){}) is undefined".</p>

<pre><code>final LinearLayout LinLayBtn = new LinearLayout(this);
ImageView ivBtn = new ImageView(this);
ivBtn = mkatt.makeKey( ivBtn, btnHue, btnSat, buttonScale, buttonScaleCnt, textAdjust, btnTextColor, buttonText, btnOpa, spacingLR, spacingTB);
LinLayBtn.addView(ivBtn);

LinLayBtn.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {

        LinLayBtn.removeAllViews();
        ImageView ivBtn = new ImageView(this); // The constructor ImageView(new View.OnClickListener(){}) is undefined
        ivBtn = mkatt.makeKey( ivBtn, btnHue, btnSat, buttonScale, buttonScaleCnt, textAdjust, btnTextColor, buttonText, btnOpa, spacingLR, spacingTB);
        LinLayBtn.addView(ivBtn);

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

<p>Any ideas what to do with it?</p>

<p>Thanks!</p>
